[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2013) While Using DetachedCriteria as subselect if the detached criteria has a subCriteria exception is being thrown

Dilip Ranjith (JIRA) noreply at atlassian.com
Tue Aug 22 06:39:18 EDT 2006


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

Dilip Ranjith commented on HHH-2013:
------------------------------------

I forgot to put this with above comment.

DetachedCriteria detachedCriteria = DetachedCriteria.forClass(Shop.class);
detachedCriteria .createCriteria("productDTO").add(Restrictions.eq("ID", productCode.toString()));
shopSet = new LinkedHashSet(detachedCriteria .getExecutableCriteria(session).list()); ---> Works correctly

detachedCriteria .setProjection(Projections.property("ID"));----------> projection in DetachedCriteria

Criteria criteria = session.createCriteria(StatusDTO.class);
criteria .add(Property.forName("transactionID").in(detachedCriteria ));
criteria .list() --------------> (Gives exception) 
when i execeute this code the query generate doesnot have a " left join shop..productDTO as PRODUCTMAS1_"  resulting in INVALID IDENTIFIER exception

> While Using DetachedCriteria as subselect if the detached criteria has a subCriteria exception is being thrown
> --------------------------------------------------------------------------------------------------------------
>
>          Key: HHH-2013
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2013
>      Project: Hibernate3
>         Type: Bug

>     Versions: 3.0.5
>  Environment: HIbernate 3.0.5 Oracle
>     Reporter: Dilip Ranjith

>
>
> While Using DetachedCriteria as subselect if the detached criteria has a subCriteria exception is being thrown
> DetachedCriteria detachedCriteria = DetachedCriteria.forClass(Shop.class);
> detachedCriteria .createCriteria("productDTO").add(Restrictions.eq("ID", productCode.toString()));
> shopSet = new LinkedHashSet(detachedCriteria .getExecutableCriteria(session).list()); ---> Works correctly
> detachedCriteria .setProjection(Projections.property("ID"));----------> projection in DetachedCriteria
> Criteria criteria = session.createCriteria(StatusDTO.class);
> criteria .add(Property.forName("transactionID").in(detachedCriteria )); 
> criteria .list() --------------> (Gives exception)
> Throws an SQLGrammerException 
> java.sql.SQLException: ORA-00904: "PRODUCTMAS1_"."PRODUCTID": invalid identifier

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