-->
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: Hiebernate Loading object in model based on database column
PostPosted: Wed Jul 19, 2006 11:51 am 
Newbie

Joined: Wed Jul 19, 2006 10:59 am
Posts: 1
I am new at hibernate and need help implementing
the following.




Given a POJO model EntityModel, with attribute entityObject of type IEntity interface

Assume both EntityA and EntityB implements interface IEntity.

The mapping column in the table associated with EntityModel is
CDE_LOC.

Here is what I want to do:

1. If CDE_LOC value is in list (“'01','02','03','04','05','06','07','08','09','10'”) then EntityA is loaded
2. If CDE_LOC value is in list
("'S','T','U','V','W','X','Y','Z') then EntityB is loaded


Here is a pseudo code of what I have in mind.

<any name="entityObject" meta-type="string" id-type="integer" cascade="none" update="false" insert="false">
<meta-value class="EntityA" value in ("'01','02','03','04','05','06','07','08','09','10'") />

<meta-value class=" EntityB" value in ("'S','T','U','V','W','X','Y','Z'") />
<column name="CDE_LOC" />
</any>


As an alternative to the pseudo code above, could I repeat the same entity in multiple lines as shown below?

<any name=" entityObject " meta-type="string" id-type="integer" cascade="none" update="false" insert="false">
<meta-value class="EntityA" value = "01" />
<meta-value class="EntityA" value = "02" />
<meta-value class="EntityA" value = "03" />
....
<meta-value class="EntityB" value = "S" />
<meta-value class="EntityB" value = "T" />
<meta-value class="EntityB” value = "U" />
...
<column name="CDE_LOC" />
</any>




Please help.


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.