Hello!
I would be pleased if you could help me with an issue that seems quite strange to me. I'm new to Hibernate, so please excuse me if it is a dumb question.
I have the Java classes "PropertyNameEntity" and "PropertyValueEntity".
The class "PropertyValueEntity" has an EmbeddedId referencing a class called "PropertyValuePK". This EmbeddedId class contains a ManyToOne Association to the class "PropertyNameEntity".
Everything is working fine, but a problem arises when I want to execute the following Hibernate Criteria Query:
Code:
crit = session
.createCriteria(PropertyValueEntity.class)
.createCriteria("propertyValuePK")
.createCriteria("propertyNameEntity")
.add(Restrictions.like("name", "GSM"));
I get the following error:
Code:
WARNUNG: SQL Error: 1054, SQLState: 42S22
21.09.2010 18:41:17 org.hibernate.util.JDBCExceptionReporter logExceptions
SCHWERWIEGEND: Unknown column 'propertyna2_.name' in 'where clause'
Exception in thread "main" org.hibernate.exception.SQLGrammarException: could not execute query
The "createCriteria" statements are working. The error only arises when I add the "Restriction" to the criteria.
Thank u for any information!