[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:36:19 EDT 2006
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2013?page=comments#action_24010 ]
Dilip Ranjith commented on HHH-2013:
------------------------------------
<many-to-one
name="productDTO"
class="com.product.dto.ProductMasterDTO"
cascade="none"
outer-join="true"
update="true"
insert="true"
access="property"
column="PRODUCTID"
/>
I donot think the BUG is with 'detachedCriteria .setProjection(Projections.property("ID"));' i think its on ' detachedCriteria .createCriteria("productDTO").add(Restrictions.eq("ID", productCode.toString())); '
Because when we replace above code by ' detachedCriteria .add(Restrictions.eq("productDTO.ID", productCode.toString()));
it works correctly.
> 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