[hibernate-issues] [Hibernate-JIRA] Closed: (HHH-1090) Allow subqueries on criteria to obtain non-string results

Steve Ebersole (JIRA) noreply at atlassian.com
Mon Mar 21 13:00:55 EDT 2011


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1090?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Ebersole closed HHH-1090.
-------------------------------


Closing stale resolved issues

> Allow subqueries on criteria to obtain non-string results
> ---------------------------------------------------------
>
>                 Key: HHH-1090
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1090
>             Project: Hibernate Core
>          Issue Type: Patch
>            Reporter: Jordi Sola Alaball
>             Fix For: 3.1 rc3
>
>         Attachments: Subqueries.java
>
>
> Hibernate Subqueries allows a group of operations with a subquery, p.e:
> SELECT * FROM book AS books
> WHERE books.bookname IN (SELECT name FROM preferedBooks AS prefered WHERE books.bookID=prefered.bookID)
> A second way of operating with subqueries is offering a constant to subquery operation:
> SELECT * FROM book AS books WHERE "Arthur Connan Doyle" IN (SELECT name FROM bookAuthors WHERE books.bookID=prefered.bookID)
> The found problems is when constant is not an string. 
> SELECT * FROM book AS books WHERE 10 IN (SELECT price FROM bookPriceHistory WHERE books.bookID=prefered.bookID)
> Subquery object define subquery operations with only a String parameter:
> public class Subqueries {
> ...
> public static Criterion in(String value, DetachedCriteria dc) {
> return new SimpleSubqueryExpression(value, "in", null, dc);
> }
> So comparison of subquery result with a non-string object is not available. Since SubQueryExpression allow an Object parameter, Subquery also should. A possible patch for this may be:
> public class Subqueries {
> ...
> public static Criterion in(Object value, DetachedCriteria dc) {
> return new SimpleSubqueryExpression(value, "in", null, dc);
> }

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