У меня есть исключение org.hibernate.QueryException, и я не могу понять, почему.
Свойство langue_id, не разрешенное hibernate, определено в моей сущности.
StackTrace
Caused by: org.hibernate.QueryException: could not resolve property: langue_id of: fr.sita.g2fm.domain.referentiel.Conditionnement
at org.hibernate.persister.entity.AbstractPropertyMapping.propertyException(AbstractPropertyMapping.java:62) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
at org.hibernate.persister.entity.AbstractPropertyMapping.toType(AbstractPropertyMapping.java:56) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
at org.hibernate.persister.entity.AbstractEntityPersister.toType(AbstractEntityPersister.java:1805) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
at org.hibernate.loader.criteria.EntityCriteriaInfoProvider.getType(EntityCriteriaInfoProvider.java:39) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
at org.hibernate.loader.criteria.CriteriaQueryTranslator.getPathInfo(CriteriaQueryTranslator.java:228) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
at org.hibernate.loader.criteria.CriteriaQueryTranslator.createCriteriaEntityNameMap(CriteriaQueryTranslator.java:212) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
at org.hibernate.loader.criteria.CriteriaQueryTranslator.<init>(CriteriaQueryTranslator.java:94) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
at org.hibernate.loader.criteria.CriteriaLoader.<init>(CriteriaLoader.java:71) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1760) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
at org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:363) ~[hibernate-core-5.0.12.Final.jar:5.0.12.Final]
Entity
@Entity
@Data
@Table(uniqueConstraints = @UniqueConstraint(name = "UNIQUE_CONDITIONNEMENT_DESIGNATION", columnNames = {
"designation"}))
public class Conditionnement implements IdObject, Serializable {
private static final long serialVersionUID = 7096113289274101792L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private Long codeConditionnement;
@NotNull(message = ERROR_CODE_MANDATORY_FIELD)
private String designation;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "langue_id")
@NotNull(message = ERROR_CODE_MANDATORY_FIELD)
@ForeignKey(name = "FK_CONDITIONNEMENT_LANGUE")
private Langue langue;
}
Наконец метод в моем DAO
@Override
public List<Conditionnement> find(ConditionnementCriteria conditionnementCriteria) {
Criteria criteria = getHibernateSession().createCriteria(Conditionnement.class, "c");
criteria.createCriteria("c.langue_id", "l", JoinType.LEFT_OUTER_JOIN);
return criteria.list();
}
У вас есть идеи, что вызвало это исключение?
Спасибо за вашу помощь.