[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-5735) Usage Path.type() in expressions throws java.lang.IllegalArgumentException

Gail Badner (JIRA) noreply at atlassian.com
Wed May 4 02:02:05 EDT 2011


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5735?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gail Badner updated HHH-5735:
-----------------------------

    Fix Version/s:     (was: 3.6.4)
                       (was: 4.0.0.Alpha3)
                   4.0.0.Beta1
                   3.6.5

> 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
>             Fix For: 3.6.5, 4.0.0.Beta1
>
>         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.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list