2 Replies Latest reply on Apr 8, 2009 1:05 PM by Amar Singh

    Greedy loading (default-lazy=

    Amar Singh Newbie

      I have an Entity GP which has a many to one association to entity CA.

      <hibernate-mapping auto-import="true" default-lazy="false">
      <class name=GP table=GP_table>
       <id name="id" type="string" column="GP_ID"/>
       <many-to-one name="ca" class="CA" column="C_ID" cascade="none"/>
      <class name="CA" table="CA_TABLE" batch-size="64" >
       <id name="id" type="string" column="C_ID" />

      With this when I load a previous version of GP, the loading mechanism tries to create a proxy for CA, but in my case lazy is false so an internal call to createProxy will return NULL hence .

      This happens in ToOneIdMapper.java in method mapToEntityFromMap around line 82, which then internally calls for AbstractEntityTuplizer.java line 395 for getProxyFactory() ending in NULL pointer exception because proxy factory is null as mine is a greedy loading.

      Is this a bug ?

      Thanks Adam.