-->
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.  [ 2 posts ] 
Author Message
 Post subject: Mapping for One Object to Multiple tables without using join
PostPosted: Thu Dec 29, 2005 9:42 am 
Newbie

Joined: Wed Nov 30, 2005 9:04 am
Posts: 8
Location: Bangalore
Dear Technical Staff,

I need your help. I have an Object, it has firstName,LastName,age,sex and so on.. I want to map this Object to 4 or 5 tables. The tables may or may not have relationships. Using join we can do it, but all the relational tables will have relationship. It means that other table will refer the primary key of the first table. But my client's requirement is somewhat different. I am unable to write that mapping file. When I created three mapping files for one Object and tried to put in hibernate.cfg.xml file, it is throwing exception like duplicate mapping exception.... like this. Please give me any code snnippet for mapping file to map one object to multiple tables without using <join> or give me any link so that I can read and prepare the mapping file . Please help me

Please respond to me in piku.mishra@gmail.com

_________________
Piku Mishra


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 30, 2005 5:53 pm 
Newbie

Joined: Fri Feb 06, 2004 1:37 pm
Posts: 9
If I understand your question correctly, I beleive you want to specify an entity-name:

Code:
<hibernate-mapping package="com.foo.bar">
    <class name="Person" entity-name="User" table="USER">
    ...
    </class>
    <class name="Person" entity-name="Admin" table="ADMIN">
    ...
    </class>
</hibernate-mapping>


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

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.