[hibernate-issues] [Hibernate-JIRA] Created: (HHH-3895) accessing proxy will not unwrap / initialize entity if the accessed property is the primary-key / id of the entity

Alexander Fröhlich (JIRA) noreply at atlassian.com
Tue May 5 12:44:17 EDT 2009


accessing proxy will not unwrap / initialize entity if the accessed property is the primary-key / id of the entity
------------------------------------------------------------------------------------------------------------------

                 Key: HHH-3895
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3895
             Project: Hibernate Core
          Issue Type: Bug
         Environment: Envers 3.5 with Hibernate Core, -annotations, -common-annotations 3.5 and Spring
            Reporter: Alexander Fröhlich


An audited entity - which is a property of the audited entity I fetch from db - will return null if I call getPk() / getID() on it, where pk / id is the primary key of the entity.

mainEntity = auditReader.createQuery()for.....getSingleResult();
mainEntity.getPk(); // returns pk - fine
mainEntity.getPropertyEntity().getPk(); // returns null IF no other properties of 'propertyEntity' have been accessed before
mainEntity.getPropertyEntity().getAnyOtherProperty(); // all fine
 

see forum for more details:
http://www.jboss.org/index.html?module=bb&op=viewtopic&t=154798


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