[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2952) Support for referencing non-root entities in Criteria SQL expressions

Günter Graf (JIRA) noreply at atlassian.com
Wed Jul 8 03:19:15 EDT 2009


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

Günter Graf commented on HHH-2952:
----------------------------------

@ Sergey Pulyaev:
I tried to add your files to my project, but there are two issues in the SQLAliasedCriterion and SQLAliasedProjection classes: 
1st: The method getAliasedCriteria(String) from the type CriteriaQueryTranslator is not visible
2nd: The method getOuterQueryTranslator() is undefined for the type CriteriaQueryTranslator

Do I have to do anything else to get your classes working?

note: i am using Hibernate 3.2.5, so there may have been changes in Hibernate that cause your files not being usable anymore.


If there's allready another approacht for using aliases in the sqlRestriction method, I would appreciate to hear of it.

> Support for referencing non-root entities in Criteria SQL expressions
> ---------------------------------------------------------------------
>
>                 Key: HHH-2952
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2952
>             Project: Hibernate Core
>          Issue Type: Improvement
>          Components: query-criteria
>    Affects Versions: 3.2.2
>         Environment: Java 5, MySQL 5.0, Eclipse 3.2
>            Reporter: Jacob Gyllenstierna
>            Assignee: Diego Plentz
>         Attachments: RestrictionsExt.java, SQLAliasedCriterion.java, SQLAliasedProjection.java
>
>
> It would be very helpful to be able to reference non-root entities in Criteria SQL restrictions and projections using placeholders similar to {alias}. A very simple but uninteresting example:
> criteria.createAlias("group", "g");
> criteria.add(Restrictions.sqlRestriction("{g}.id=:groupId"));

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