Java Mailing List Archive

http://www.gg3721.com/

Home » Hibernate Issues List »

[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-1570)
criteria-api: filtering by key-many-to-one causes invalid sql

Anupam M (JIRA)

2010-07-22


Author LoginPost Reply

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

Julien HENRY commented on HHH-1570:
-----------------------------------

Problem is still here with Hibernate 3.5 and 3.6. Both with hibernate and JPA 2 criteria APIs.

> criteria-api: filtering by key-many-to-one causes invalid sql
> -------------------------------------------------------------
>
>           Key: HHH-1570
>           URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1570
>         Project: Hibernate Core
>       Issue Type: Bug
>       Components: query-criteria
>   Affects Versions: 3.1.2
>        Reporter: Joris Verschoor
>      Attachments: hibernate.patch
>
>
> We have a class Price that has a composite-id using a couple of key-properties and some key-many-to-ones)
> One of those is "transportation", which has a many-to-one to transportationType
> When we query using: criteria.add(Expression.eq("price.transportation.transportationType.id", transId);, we get an invalid SQL statement: The table of transportation was not selected.
> I will try to make a testcase today or tomorrow, depending on my schedule.. Things will be more clear by then...
> We have created a work-around, by mapping the transportationID twice: once in key-property, and once as a many-to-one. (instead of one key-many-to-one)

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

   
_______________________________________________
hibernate-issues mailing list
hibernate-issues@(protected)
https://lists.jboss.org/mailman/listinfo/hibernate-issues
©2008 gg3721.com - Jax Systems, LLC, U.S.A.