-->
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 over 2 tables
PostPosted: Mon May 12, 2008 5:22 pm 
Newbie

Joined: Mon May 12, 2008 4:13 pm
Posts: 1
Hey,

I have a situation when there are 2 tables that are already exist and related to each other using one-to-many relation.
I want to merge them under the same class so when our programmers will work with the tables they could refer to them using one class and not 2 different classes.

For example, if I have these 2 tables under our system:

Table 1: Person_Private_Information
    full_name
    birthday

Table 2: Person_Public_Information
    nickname
    resume


I would like to create one class:

Code:
public class Person {
private String fullname;
private String password;
private String nickname;
private String resume;
}


that will work in front of the tables as if it was only one table.

What is the best solution possible for this situation?

Can this solution be implemented using a View (so the class will work over the view instead of working in front of the tables)?

The database that we want to work under is Oracle 10g database.

Thank you,
Tal.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 13, 2008 5:08 am 
Regular
Regular

Joined: Mon Aug 06, 2007 10:49 am
Posts: 67
Location: Banska Bystrica, Slovakia
u can use <join> element - http://www.hibernate.org/hib_docs/v3/re ... ation-join

also u can use a view, but i doubt u can do any ddl operation or with limitation (save, update ...)


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.