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

Jaroslaw Lewandowski (JIRA) noreply at atlassian.com
Tue Nov 16 07:29:16 EST 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5735?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=39129#action_39129 ] 

Jaroslaw Lewandowski commented on HHH-5735:
-------------------------------------------

I have to mention that this test passes in reference implementation of JPA 2.0 - EclipseLink (this one actually works there ;)

> 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
>         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