[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-3171) Class with @IdClass gets lazy-loaded when "id" field accessed

Carl Allain (JIRA) noreply at atlassian.com
Mon Mar 10 13:20:33 EDT 2008


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3171?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carl Allain updated HHH-3171:
-----------------------------

    Attachment: CountrySubdivisionPdoWithIdClass.java
                CountrySubdivisionPdoWithEmbeddedId.java
                BugIdClassIds.java

when running BugIdClassIds.java we obtain the following output:

 --- countrySubdivisionWithEmbeddedIdPdo -------------------------------
QC
CA
 --- countrySubdivisionWithIdClass -------------------------------------
Hibernate: 
    /* load tests.CountrySubdivisionPdoWithIdClass */ select
        countrysub0_.CTRSD_CD as CTRSD1_0_0_,
        countrysub0_.CTR_ISO_CD as CTR2_0_0_ 
    from
        PLGE_CTRSD countrysub0_ 
    where
        countrysub0_.CTRSD_CD=? 
        and countrysub0_.CTR_ISO_CD=?
QC
CA

which demonstrates the unwanted lazy-loading-when-accessing-id-field behavior.

> Class with @IdClass gets lazy-loaded when "id" field accessed 
> --------------------------------------------------------------
>
>                 Key: HHH-3171
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3171
>             Project: Hibernate3
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.2.6
>         Environment: Postgres 8.2.5 (also with Oracle 10g)
>            Reporter: Carl Allain
>         Attachments: BugIdClassIds.java, CountrySubdivisionPdoWithEmbeddedId.java, CountrySubdivisionPdoWithIdClass.java
>
>
> Getting id values from Hibernate Proxy cause unwanted lazy initialization when using composite key and IdClass annotation. Lazy initialization behavior should be the same as when using EmbeddedId annotation instead of IdClass since we're accessing fields marked with Id annotation and their value has been provided for the Hibernate Proxy creation.

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