Hibernate jette HibernateQueryException: impossible de résoudre propriété

Donc, j'ai un tableau que j'ai défini comme une entité en veille prolongée comme ceci:

@Entity
@Table(name = "sec_Preference")
public class Preference {
private long id;
@Column(name = "PreferenceId", nullable = false, insertable = true, updatable = true, length = 19, precision = 0)
@GeneratedValue(strategy = GenerationType.AUTO)
@Id
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
private long systemuserid;
@Column(name = "SystemUserId", nullable = true, insertable = true, updatable = true, length = 19, precision = 0)
@Basic
public long getSystemUserId() {
return systemuserid;
}
public void setSystemUserId(long systemuserid) {
this.systemuserid = systemuserid;
}
private long dbgroupid;
@Column(name = "DBGroupId", nullable = true, insertable = true, updatable = true, length = 19, precision = 0)
@Basic
public long getDBGroupId() {
return dbgroupid;
}
public void setDBGroupId(long dbgroupid) {
this.dbgroupid = dbgroupid;
}
private long externalgroupid;
@Column(name = "ExternalGroupId", nullable = true, insertable = true, updatable = true, length = 19, precision = 0)
@Basic
public long getExternalGroupId() {
return externalgroupid;
}
public void setExternalGroupId(long externalgroupid) {
this.externalgroupid = externalgroupid;
}
private long securityroleid;
@Column(name = "SecurityRoleId", nullable = true, insertable = true, updatable = true, length = 19, precision = 0)
@Basic
public long getSecurityRoleId() {
return securityroleid;
}
public void setSecurityRoleId(long securityroleid) {
this.securityroleid = securityroleid;
}
public void setEnum(com.vitalimages.common.server.security.Preference pref) {
this.preferencekey = pref.name();
}
private String preferencekey;
@Column(name = "PreferenceKey", nullable = false, insertable = true, updatable = true, length = 255, precision = 0)
@Basic
public String getKey() {
return preferencekey;
}
public void setKey(String key) {
this.preferencekey = key;
}
private String preferencevalue;
@Column(name = "PreferenceValue", nullable = true, insertable = true, updatable = true, length = 255, precision = 0)
@Basic
public String getValue() {
return preferencevalue;
}
public void setValue(String value) {
this.preferencevalue = value;
}
}

Quand j'ai essayé d'écrire une simple requête à l'encontre de ce tableau:

public Collection<Preference> getPreferencesForDBGroup(long dbgroupId) {
final DetachedCriteria criteria = DetachedCriteria.forClass(Preference.class)
.add(Restrictions.eq("dbgroupid", dbgroupId))
.setResultTransformer(DistinctRootEntityResultTransformer.INSTANCE);
return getHibernateTemplate().findByCriteria(criteria);
}

J'ai eu l'erreur suivante:

org.springframework.orm.hibernate3.HibernateQueryException: could not resolve property: dbgroupid of: com.common.server.domain.sec.Preference; nested exception is org.hibernate.QueryException: could not resolve property: dbgroupid of: com.common.server.domain.sec.Preference

Pourquoi ne peut-hibernate comprendre ce dbgroupid est sur ma classe?

OriginalL'auteur Grant Cermak | 2010-12-14