These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Out of Memory Exception loading entity
PostPosted: Wed Feb 07, 2007 7:36 pm 
Newbie

Joined: Wed Feb 07, 2007 7:23 pm
Posts: 1
I am trying to load an entity and it results in out of memory exception.

Here is my case:
I have Entity A which has 1-2-many relationship with Entity B.
Entity B has 1-2-many relationship with Entity C.

I have added filter conditions in Entity A's hbm to load only those entities whoes id matches with id passed.

I also have lazy="true" for Entity B and C.
Bellow is the mapping files.

Entity A
<hibernate-mapping>
<class name="Entity A" table="TABLE1">
<id name="id" type="long">
<column name="ID" scale="0" />
<generator class="assigned" />
</id>
<property name="name" type="string">
<column name="NAME" length="64" not-null="true" />
</property>
<property name="Number" type="string">
<column name="NUMBER" length="2048" />
</property>

<list name="entityb"
table="TABLE2"
lazy="true"
inverse="false"
outer-join="false"
>
<key column="ID"/>
<list-index column="id"/>
<one-to-many class="Entity B"/>
<filter name="filter1" condition=":id = ID" />
</list>
</class>
<filter-def name="filter1">
<filter-param name="id" type="long"/>
</filter-def>
</hibernate-mapping>

Entity B
<hibernate-mapping>
<class name="Entity B" table="TABLE2">
<id name="id" type="long">
<column name="ID" scale="0" />
<generator class="assigned" />
</id>

<property name="status" type="string">
<column name="STATUS" not-null="true" />
</property>

<list name="entityc"
table="TABLE3"
lazy="true"
inverse="false"
outer-join="false"
>
<key column="ID"/>
<list-index column="id"/>
<one-to-many class="ENTITY C"/>
</list>

<many-to-one
name="entityA"
class="ENTITY A"
cascade="none"
outer-join="false"
column="ID"
not-null="true"
/>
</class>

</hibernate-mapping>

Entity C
<hibernate-mapping>
<class name="ENTITY C" table="TABLE3">
<id name="id" type="long">
<column name="ID" scale="0" />
<generator class="assigned" />
</id>

<many-to-one
name="entityb"
class="ENTITY B"
cascade="none"
outer-join="false"
column="ID"
not-null="true"
/>
</class>
</hibernate-mapping>

Any idea whats going wrong.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.