[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5735?page=c...
]
S. Yves commented on HHH-5735:
------------------------------
Is there any workaround whatsoever available to solve this issue without having to have to
wait for the next releases?
I need a criteria that would include/exclude some of the subclasses of the classes
hierarchy tree.
Which test fails anyway? Is it just the EQUAL expression, or is there any chance the IN
would work?
Thanks
Usage Path.type() in expressions throws
java.lang.IllegalArgumentException
---------------------------------------------------------------------------
Key: HHH-5735
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5735
Project: Hibernate Core
Issue Type: Bug
Components: query-criteria
Affects Versions: 3.6.0, 3.6.1
Reporter: Jaroslaw Lewandowski
Priority: Blocker
Fix For: 3.6.next, 4.0.0.Alpha1
Attachments: InheritanceTest.tgz
It is not possible to filter entities using Path.type() in Criteria Query API. Using
type() in expressions throws an exception:
Unexpected call on EntityTypeExpression#render
java.lang.IllegalArgumentException: Unexpected call on EntityTypeExpression#render
at org.hibernate.ejb.criteria.expression.PathTypeExpression.render( at
org.hibernate.ejb.criteria.expression.PathTypeExpression.render(PathTypeExpression.java:48PathTypeExpression.java:48)
)
at
org.hibernate.ejb.criteria.predicate.ComparisonPredicate.render(ComparisonPredicate.java:173)
at org.hibernate.ejb.criteria.QueryStructure.render(QueryStructure.java:258)
at
org.hibernate.ejb.criteria.CriteriaQueryImpl.render(CriteriaQueryImpl.java:340)
at
org.hibernate.ejb.criteria.CriteriaQueryCompiler.compile(CriteriaQueryCompiler.java:223)
at
org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:441)
at foo.InheritanceTest.critQryTest(InheritanceTest.java:55)
Test case is attached and it's similar to an example from JPA 2.0 specification -
chapter 6.5.7 Example 2:
CriteriaQuery<Employee> q = cb.createQuery(Employee.class);
Root<Employee> emp = q.from(Employee.class);
q.select(emp)
.where(cb.notEqual(emp.type(), Exempt.class));
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira