pramodkp wrote:
Hi,
Yes. Here is an example.
<many-to-one name="objectOne" column="ref_id" />
<many-to-one name="objectTwo" column="ref_id" insert="false" update="false"/>
Here, we are forced to make atleast one association 'read-only'.
-----------------------------------------
Rate the reply if you find it helpful
Thanks for your reply Pramod. But still i'm in problem. I've even tested yr way.
<class name="UserRoles">
.
.
.
<many-to-one name="roleOfTypeSubscriberSponsor" column="entity_id" cascade="all" class="net.subscriber.SubscriberSponsor" not-found="ignore"/>
<many-to-one name="roleOfTypeMentor" column="entity_id" cascade="all" class="net.mentor.Mentor" not-found="ignore" insert="false" update="false"/>
<many-to-one name="roleOfTypeMonitor" column="entity_id" cascade="all" class="net.monitor.Monitor" not-found="ignore" insert="false" update="false"/>
<many-to-one name="roleOfTypeCorporateSponsor" column="entity_id" cascade="all" class="net.corporatesponsor.CorporateSponsor" not-found="ignore" insert="false" update="false"/>
</class>
My relationship is like the above - so a single column entity_id will map to different objects.
Its like a user can me of any kind. So entity_id will be a foreign key for different table.
Please help me out
-Vikash