[hibernate-issues] [Hibernate-JIRA] Resolved: (HHH-1685) DetachedCriteria doesn't create alias on subcriteria
Diego Pires Plentz (JIRA)
noreply at atlassian.com
Sat Sep 8 17:29:16 EDT 2007
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1685?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Diego Pires Plentz resolved HHH-1685.
-------------------------------------
Resolution: Fixed
Fix Version/s: 3.2.6
Done in trunk/branch 3.2
> DetachedCriteria doesn't create alias on subcriteria
> ----------------------------------------------------
>
> Key: HHH-1685
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1685
> Project: Hibernate3
> Issue Type: Bug
> Components: query-criteria
> Affects Versions: 3.2.5
> Reporter: John
> Assignee: Diego Pires Plentz
> Fix For: 3.2.6
>
> Attachments: hhh1685-example.txt
>
>
> DetachedCriteria has two createCriteria methods:
> public DetachedCriteria createCriteria(String associationPath) throws HibernateException
> public DetachedCriteria createCriteria(String associationPath, String alias) throws HibernateException
> However, the code for both was identical - they called the inner criteria's createCriteria(String) method. The version with the alias did not call the inner's version with the alias. The following patch snipped shows the change:
> public DetachedCriteria createCriteria(String associationPath, String alias)
> throws HibernateException {
> - return new DetachedCriteria( impl, criteria.createCriteria(associationPath) );
> + return new DetachedCriteria( impl, criteria.createCriteria(associationPath, alias) );
> }
> This bug was discovered while trying to link a 2-deep subquery to its parent via aliases. (Surfacing this issue might only be possible with the patch HHH-952 in place - I'm not sure. Seems like a bug regardless, as it definitely fixed my alias reference issue.) I'll get an example posted shortly.
--
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