From: <leg...@at...> - 2003-08-12 19:38:09
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-253 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-253 Summary: Filter with "elements(this.employees)" clause Type: Bug Status: Unassigned Priority: Major Project: Hibernate2 Versions: 2.1 beta 1 Assignee: Reporter: Alessandro Vernet Created: Tue, 12 Aug 2003 2:20 PM Updated: Tue, 12 Aug 2003 2:20 PM Description: I am doing a: session.filter(regions, "where ? in elements(this.employees)", employee, Hibernate.entity(Employee.class)); Where Region.hbm.xml defines employees as: <hibernate-mapping> <class name="bean.Region" table="owf_region" mutable="false"> ... <set name="employees" table="owf_employee_region"> <key column="region_id"/> <many-to-many class="bean.Employee" column="employee_id"/> </set> </class> </hibernate-mapping> I get: net.sf.hibernate.QueryException: could not resolve property: employees [where ? in elements(this.employees)] at net.sf.hibernate.persister.AbstractPropertyMapping.getPropertyType(AbstractPropertyMapping.java:33) at net.sf.hibernate.hql.PathExpressionParser.getPropertyType(PathExpressionParser.java:242) at net.sf.hibernate.hql.PathExpressionParser.token(PathExpressionParser.java:122) at net.sf.hibernate.hql.WhereParser.doPathExpression(WhereParser.java:333) at net.sf.hibernate.hql.WhereParser.doToken(WhereParser.java:365) at net.sf.hibernate.hql.WhereParser.token(WhereParser.java:250) at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87) at net.sf.hibernate.hql.PreprocessingParser.end(PreprocessingParser.java:142) at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:30) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:148) at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:135) at net.sf.hibernate.hql.FilterTranslator.compile(FilterTranslator.java:25) at net.sf.hibernate.impl.SessionFactoryImpl.getFilter(SessionFactoryImpl.java:269) at net.sf.hibernate.impl.SessionImpl.getFilterTranslator(SessionImpl.java:3149) at net.sf.hibernate.impl.SessionImpl.filter(SessionImpl.java:3169) at net.sf.hibernate.impl.SessionImpl.filter(SessionImpl.java:3109) I expected this to work. Pretty much the same HQL works just fine when used in a session.createQuery(), e.g.: session.createQuery("from Region as r where ? in elements(r.employees)").setEntity(0, employee).list() Alex --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |