-->
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: One class having several fields to Multiple Tables mapping
PostPosted: Sat Dec 31, 2005 8:33 am 
Newbie

Joined: Wed Nov 30, 2005 9:04 am
Posts: 8
Location: Bangalore
Dear Sir,
In response to your reply, I worked accordingly, but I was getting exception like org.Hibernate.HinbernateMappingException. Now I want to make my question more clear and lucid. My requirement is that I have a class like this
public class Employee {
Long id;
String firstName;
String lastName;
String designation;
String address ;
String emailId;
int age;
int salary;
}

I have to store the data in Multiple tables like this.
TABLE 1
id(pk) firstName lastName

TABLE 2
id(pk) Designation Adress

TABLE 3
id EmailId age salary

All tables are independent.
Table 1 may have 10 rows, Table 2 may have 13 rows, Table 3 may have 40 rows

Please help me how to do it. This my requirement. Please give me the mapping code snippet. I have to resolve this issue. I will write one mapping file that will store data in the multiple tables. I have a class that has a method storeDataInDatabase(String fname,Strin lname....like this). I should not use <join>. Because using <join> I have tables that will refer the primary key of first table .

I will be happy if you give me some links on flexible mappings. Besides give me any link how to know the syntax of writing hibernate mapping file. I am simply following the standard mapping file.

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

_________________
Piku Mishra


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 01, 2006 11:40 pm 
Regular
Regular

Joined: Fri Sep 09, 2005 11:35 am
Posts: 101
i do not think this can be done. the tables need to related to each other.


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.