-->
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: Mapping file for table that has two classes for attr mapping
PostPosted: Tue Dec 22, 2009 5:56 am 
Newbie

Joined: Thu Nov 06, 2008 3:42 am
Posts: 15
Hi I have a table Employee with fields
emp_id
emp_name
emp_role
created_by
updated_by
For this I have defined classes
Code:
Class UserInfo{
private int created_by;
private int updated_by;
<<Getters & Setters>>
}

Class Employee{
private int empID;
private String empName;
private String empRole;
<<Getters & Setters>>
}

The reason I have a class called UserInfo is because I can use this class for all other tables. The usage of UserInfo inside employee is given below
Code:
Class Employee{
private int empID;
private String empName;
private String empRole;

private UserInfo userInfo;
<<Getters & Setters>>
}

Questions:
1. I am not sure whether I can do like this or not. Would you please tell whether I can do this way?
2. I had even problems to put the Mapping class too for the same. Would you please how I can do this?

Thanks in advance,
Sham.


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.