[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-1699) "where" attribute not include to join condition

Julien HENRY (JIRA) noreply at atlassian.com
Wed Oct 24 03:35:40 EDT 2007


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

Julien HENRY commented on HHH-1699:
-----------------------------------

Same problem for me (but with only one entity) :

<class name="Employee" table="employee" where="system='f'">
...
<many-to-one name="inlineSuperior" class="Employee" lazy="true"...

I get :

select * from employee e1, employee e2 
where e1.inlineSuperior=e2.id(+) 
        and (
            e1.system='f'
        ) 

Should be:

select * from employee e1, employee e2 
where e1.inlineSuperior=e2.id(+) 
        and (
            e1.system='f'
        ) 
        and (
            e2.system='f'
        ) 


> "where" attribute not include to join condition
> -----------------------------------------------
>
>                 Key: HHH-1699
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1699
>             Project: Hibernate3
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.1.3
>            Reporter: Renat Yusupov
>            Priority: Critical
>
> So, 
> <class name="SomeObject1" table="table1" where="system='f'">
> ...
> and
> <class name="SomeObject2" table="table2">
> ...
> <many-to-one name="someobject1" class="SomeObject1" lazy="true" ...
> In HQL query:
> "from SomeObject2 a join fetch a.someobject1"
> generated folowing SQL:
> select * from table2 inner join table1 on (table2.someobject1_id=table1.id)
> In this query where attribute is absent.
> Right folowing SQL:
> select * from table2 inner join table1 on (table2.someobject1_id=table1.id and table1.system='f' )
> I pached AbstractEntityPersister.
> There is diff:
> 2514a2515
> >                                               ,getSQLWhereString(generateTableAlias( name, j ))

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