[hibernate-issues] [Hibernate-JIRA] Created: (HHH-3938) One-To-One Filter Applied, Non-Lazy Fetch Problem

Sandeep Vaid (JIRA) noreply at atlassian.com
Wed Jun 3 04:38:14 EDT 2009


One-To-One Filter Applied, Non-Lazy Fetch Problem
-------------------------------------------------

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


Suppose i have one-to-one association between Product and ProductBasic. and we have applied filter on ProductBasic Class.
I have applied this filter as in Java side we have one-to-one relationship between Product and ProductBasic BUT at database side
we have one-to-many relationship between PRODUCT and PRODUCTBASIC. and we apply a condition (STARTTIME < CURRETTIME < ENDTIME)
while fetching PRODUCTBASIC, and this will always give me one record out of many.
So i have put this condition as filter in ProductBasic class.

In current hibernate, one-to-one associations are always non-lazily fetched. Moreover it doesn't apply filter conditions.
I understand that it can;t apply filter condition as some filter parameter must be provided at runtime and
user may not provide them (as he is not asking for ProductBasic)... Also in this case, proper proxy can't be created as 
until we apply the filter criteria, we won't get one ProductBasic row (among many)..

I think hibernate code should be changed so that if a filter is declared on the associated class (ProductBasic in our case), 
hibernate should return null for ProductBasic.

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