Hi I am using EJB QL and have the embedden version of Hibernate which is released with jboss-4.0.4.GA and am experiencing a query problrm which I cannot find a solution for. This is probably not an error, but my lack of knowledge in EJB QL.
I am trying to do this:
I have an entity (UserDescription) which have an instance of another entity (Role) with the data field 'name'. I am trying to get all instances of a UserDescription having a role named 'administrator', but I get an exception telling me that it can not resolve the property 'name'...
I am sorry for using the forum for this, but I do not where to turn... Can anyone help me?
Exception that occurs:
Code:
javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.QueryException: could not resolve property: name of: a.package.UserDescription [from a.package.UserDescription as ud fetch all properties where ( (ud.licenseHolderID = 0) ) and (ud.role.name = 'administrator')]
Debug level Hibernate log excerpt:Code:
2006-08-13 14:31:33,703 DEBUG [org.hibernate.hql.ast.AST - 84] --- HQL AST ---
\-[QUERY] 'query'
+-[SELECT_FROM] 'SELECT_FROM'
| \-[FROM] 'from'
| \-[RANGE] 'RANGE'
| +-[DOT] '.'
| | +-[DOT] '.'
| | | +-[DOT] '.'
| | | +-[IDENT] 'a'
| | | \-[IDENT] 'package'
| | \-[IDENT] 'UserDescription'
| +-[ALIAS] 'ud'
| \-[FETCH] 'fetch'
\-[WHERE] 'where'
\-[AND] 'and'
+-[EQ] '='
| +-[DOT] '.'
| | +-[IDENT] 'udd'
| | \-[IDENT] 'myLicenseHolderID'
| \-[NUM_INT] '0'
\-[EQ] '='
+-[DOT] '.'
| +-[DOT] '.'
| | +-[IDENT] 'ud'
| | \-[IDENT] 'role'
| \-[IDENT] 'name'
\-[QUOTED_STRING] ''administrator''
Hibernate version:
The default released version in JBoss Application Server 4.0.4.GA
Name and version of the database you are using:
Hypersonic SQL which is embedden in the JBoss release.