[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-1276) Add outer join support to Criteria API

Paul Kist (JIRA) noreply at atlassian.com
Thu Mar 6 09:29:33 EST 2008


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_29705 ] 

Paul Kist commented on HHH-1276:
--------------------------------

Has this patch been applied to 3.2.5ga?   We're trying to use the following method for left outer joins:

Criteria myCriteria = session.createCriteria(Employee.class);
LogicalExpression orExp = Expression.or(Expression.like("name", "%"+queryString.trim()+"%"), Expression.like("nickname", "%"+queryString.trim()+"%"));
LogicalExpression orExp2 = Expression.or(Expression.like("company.company_name",  "%"+queryString.trim()+"%"),Expression.eq("id", id));
myCriteria.setFetchMode("company", FetchMode.JOIN).add(Expression.or(orExp, orExp2));

But running the .list() generates an exception: 

Time elapse
d: 0.05 sec  <<< ERROR!
org.hibernate.QueryException: could not resolve property: company.company_name
 of: my.model.Employee
        at org.hibernate.persister.entity.AbstractPropertyMapping.propertyExcept
ion(AbstractPropertyMapping.java:44)

> Add outer join support to Criteria API
> --------------------------------------
>
>                 Key: HHH-1276
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1276
>             Project: Hibernate3
>          Issue Type: Patch
>          Components: core
>    Affects Versions: 3.1
>            Reporter: Jeremy Haile
>         Attachments: patch.txt
>
>
> Here's a patch that allows users to specify a joinType when calling createCriteria and createAlias on the Criteria interface.  This allows you to specify outer joins when creating Criteria.  If you have any questions or see anything I missed - let me know.  I have tested and am currently using the patch with no problems.

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