[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-879) Enable joining the same association twice with Criteria

Dmitry Avramenko (JIRA) noreply at atlassian.com
Mon Oct 16 21:55:29 EDT 2006


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-879?page=comments#action_24826 ] 

Dmitry Avramenko commented on HHH-879:
--------------------------------------

This is what I 've done at this point, till Hibernate team either adds support for it or I swtich to some different API..

I could not wait and I did not have time to re-write my code at this time.. 

So to make it happen, I've created a couple of VIEWS to the same table I want to join multiple times..  (So  now I have 3 views with different names to the same original table..

After that I've added additional mappings to my class to each view..

After that it is simple.. I"m NO longer joining (as far as hibernate is concerned to the same table). It thinks I'm joining to different tables.

I create aliases in a loop (append numbers to them - ala preferedCourse1, preferedCourse2, etc - upto 3 aliases in my case) and then just use in the same way if I would to the same table.
My application will never require me to generate a query in which I need to join to that table more than 4 times. so 3 views are enough..

Now this is NOT prety.. But it gets the job done in my case..

-Dmitry.


> Enable joining the same association twice with Criteria
> -------------------------------------------------------
>
>          Key: HHH-879
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-879
>      Project: Hibernate3
>         Type: Improvement

>   Components: core
>     Reporter: Vladimir Bayanov

>
>
> Make double joining the same association with Criteria.createCriteria possible. See: http://forum.hibernate.org/viewtopic.php?t=931249

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