[hibernate-issues] [Hibernate-JIRA] Created: (HHH-3929) one-to-one non-lazy loading but Filters Not Applied.

Sandeep Vaid (JIRA) noreply at atlassian.com
Wed May 27 02:25:14 EDT 2009


 one-to-one non-lazy loading but Filters Not Applied.
-----------------------------------------------------

                 Key: HHH-3929
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3929
             Project: Hibernate Core
          Issue Type: Improvement
    Affects Versions: 3.3.1
            Reporter: Sandeep Vaid


We all know that one-to-one associations are non-lazly fetched but during this fetching the filters are not applied.
I debugged hibernate code and found that hibernate finally calls EntityLoader.loadByUniqueKey() method:

public Object loadByUniqueKey(SessionImplementor session, Object key) 
	throws HibernateException {
		return load(session, key, null, null);
	}

I can understand that why filters are not applied because all one-to-one association is automatically non-lazyly fetched
and user may not have specified to fetch this associations and hence not enabled corresponding filters on session and also
not provided filter parameters. 

	
For my case it is very important that i always apply filter as in my case if i don't apply filters, it will return me more than one record as i have one-to-one assocition at Domain model level but 
same association is one-to-many at database level and by applying filter i make this one-to-many association at database level as
one-to-one association at Domain model.

Is there somehow, i can apply filters always to one-to-one association or better don;t even create a proxy of one-to-one assocaitons that 
i have not asked for?

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