]
Gareth Chapman commented on HHH-1261:
-------------------------------------
Hi,
I've been searching the web and this bug list all afternoon, but can't find any
reference to discussions on this topic. Would you please supply me with a link to the
discussions you mention, I would like to know the arguments against implementing this.
Thanks.
"WHERE" class mapping element not used during association
navigation
--------------------------------------------------------------------
Key: HHH-1261
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1261
Project: Hibernate3
Issue Type: Improvement
Components: core
Environment: All versions and platforms
Reporter: Alexei
For example a Employee->User association
Class Employee:
<class name="Employee, MyApp" table="Employee"
where="inactive=0" >
...
<many-to-one name="User" class="User, MyApp"
column="UserId" unique="true" not-null="false" >
Class User:
<class name="User, MyApp" table="Users"
where="inactive=0" >
Will generate SQL:
SELECT... FROM Employee this LEFT OUTER JOIN Users user1_ ON this.UserId=user1_.id WHERE
this.inactive=0
As you see the "user1_.deleted=0" would not be genetated and User objects will
be retrived ignoring the "inactive" flag on Users table. Similar behaviour with
<bag>, <one-to-one> and others.
This feature is important for us since we work mostly with legacy data and do not have
the luxury of designing our own databases.
I am NHibernate user and I have NHibernate request submited -
http://jira.nhibernate.org/browse/NH-467 ; however Sergey Koshcheyev would not implement
this in NHibernate unless Hibernate implements it 1st, which is quite understandable.
Also, per Gavin :
"The where clause is not used at all during association navigation. I suspect you
might be able to argue that it should be used for navigating many-to-many associations. If
you think so, sibmit a feature request to JIRA and I'll give it some thought"
(see
http://forum.hibernate.org/viewtopic.php?t=189 ).
Actually, I think I am ready to argue that top-level class definition clauses should be
used in any type of object instantiation. Would it be possible to consider this
implementation?
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: