[Hibernate-JIRA] Created: (EJB-388) Enum literals of inner Enum classes require the use of $ in EJB-QL
by Onno Molenkamp (JIRA)
Enum literals of inner Enum classes require the use of $ in EJB-QL
------------------------------------------------------------------
Key: EJB-388
URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-388
Project: Hibernate Entity Manager
Issue Type: Bug
Components: EntityManager
Affects Versions: 3.4.0.GA
Reporter: Onno Molenkamp
Priority: Minor
When I use an enum literal of an inner enum class in an EJB-QL query using the normal Java syntax for enum literals, I get the following exception:
Caused by: org.hibernate.hql.ast.QuerySyntaxException: Invalid path: 'some.package.SomeClass.SomeEnum.ENUMVALUE' [select x from some.package.SomeClass x where x.enumproperty = some.package.SomeClass.SomeEnum.ENUMVALUE]
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:54)
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:47)
at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:82)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:258)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:183)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:134)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:94)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1650)
at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:93)
... 85 more
A workaround is to use the syntax some.package.SomeClass$SomeEnum.ENUMVALUE, but I think the syntax I tried to use should also work.
--
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
16 years, 3 months
[Hibernate-JIRA] Commented: (ANN-210) @ManyToOne not working wth @Formula
by Darren Bell (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/ANN-210?page=co... ]
Darren Bell commented on ANN-210:
---------------------------------
Can someone give an example of who this can be used with [ANN-704]?
Many thanks.
> @ManyToOne not working wth @Formula
> -----------------------------------
>
> Key: ANN-210
> URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-210
> Project: Hibernate Annotations
> Issue Type: Improvement
> Components: binder
> Affects Versions: 3.1beta7
> Environment: Hibernate 3.1, PostgreSQL 8.1.1
> Reporter: Jason Long
>
> This type of mapping fails:
> @ManyToOne
> @Formula(value="( select v_pipe_offerprice.offerprice_fk from v_pipe_offerprice where v_pipe_offerprice.id = id )")
> public OfferPrice getOfferPrice() { return offerPrice; }
> While the following mapping works as expected:
> <class name="Pipe" table="t_pipe">
> ...
> <many-to-one name="offerPrice"
> class="pipetracker.model.price.OfferPrice"
> formula="( select v_pipe_offerprice.offerprice_fk
> from v_pipe_offerprice
> where v_pipe_offerprice.id = id )"/>
> ...
> </class>
> This is not being treated as a formula because the generated SQL included a referece to the field pipe.offerprice_id which does not exsist because this is a virtual column calculated from a view.
--
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
16 years, 3 months
[Hibernate-JIRA] Commented: (HHH-530) Allow application of filters on subqueries
by Shawn Clowater (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-530?page=co... ]
Shawn Clowater commented on HHH-530:
------------------------------------
Steve, will do.
If I get a chance I may even roll it into our dev environment but I am currently in the middle of mem leak hell.
> Allow application of filters on subqueries
> ------------------------------------------
>
> Key: HHH-530
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-530
> Project: Hibernate Core
> Issue Type: Patch
> Components: core
> Reporter: Gavin King
> Assignee: Steve Ebersole
> Fix For: 3.2.x, 3.3.x, 3.4
>
> Attachments: HHH-530.3.3.SP1.patch, HHH-530.3.3.SP1.take2.patch, HHH-530.Additional.Subquery.patch, HHH-530.patch, hibernate_filter_fix-3.0.5.patch, hibernate_filter_fix-3.0.5_14.patch, SubqueriesWithFiltersTest.patch
>
>
> Currently filter conditions are applied in subselects, they should not be.
--
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
16 years, 3 months
[Hibernate-JIRA] Resolved: (HHH-530) Allow application of filters on subqueries
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-530?page=co... ]
Steve Ebersole resolved HHH-530.
--------------------------------
Resolution: Fixed
Fix Version/s: 3.4
3.2.x
> Allow application of filters on subqueries
> ------------------------------------------
>
> Key: HHH-530
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-530
> Project: Hibernate Core
> Issue Type: Patch
> Components: core
> Reporter: Gavin King
> Assignee: Steve Ebersole
> Fix For: 3.2.x, 3.3.x, 3.4
>
> Attachments: HHH-530.3.3.SP1.patch, HHH-530.3.3.SP1.take2.patch, HHH-530.Additional.Subquery.patch, HHH-530.patch, hibernate_filter_fix-3.0.5.patch, hibernate_filter_fix-3.0.5_14.patch, SubqueriesWithFiltersTest.patch
>
>
> Currently filter conditions are applied in subselects, they should not be.
--
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
16 years, 3 months
[Hibernate-JIRA] Commented: (HHH-530) Allow application of filters on subqueries
by Steve Ebersole (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-530?page=co... ]
Steve Ebersole commented on HHH-530:
------------------------------------
Shawn, I am about to commit all work done here which represents a local "merge" of your work and mine. All tests you and I created pass, but still please take a look to make sure I did not miss any of your work.
Also, check HHH-3514 wrt a comment you had in the code about getting access to Session.
> Allow application of filters on subqueries
> ------------------------------------------
>
> Key: HHH-530
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-530
> Project: Hibernate Core
> Issue Type: Patch
> Components: core
> Reporter: Gavin King
> Assignee: Steve Ebersole
> Fix For: 3.3.x
>
> Attachments: HHH-530.3.3.SP1.patch, HHH-530.3.3.SP1.take2.patch, HHH-530.Additional.Subquery.patch, HHH-530.patch, hibernate_filter_fix-3.0.5.patch, hibernate_filter_fix-3.0.5_14.patch, SubqueriesWithFiltersTest.patch
>
>
> Currently filter conditions are applied in subselects, they should not be.
--
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
16 years, 3 months