This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!

Igor Semenko

Greenhorn
+ Follow
since Sep 15, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Igor Semenko

Theodore, thank you for the response.

I may probably have not specified requirements clearly, I understand that Hibernate can load related entries from another table into a list of objects of another type, in my case it would be Customer containing a set of CustomerDetails.

But I want only one object Customer to be loaded from/to different tables Customer/CustomerDetail which have the same primary key id. Basically Customer and CustomerDetails is the one table splitted into two, relation between tables is 1-1. So for one particular Customer object it would load properties "id" and "name" from table Customer and "comments" from CustomerDetails.

As for now, we come to solution when CustomerDetails is loaded as a separate object, but its propertly "comments" is exposed by delegate method in Customer class.
Is it possible to have one class to be mapped into 2 tables in hibernate?
For example, I have 2 tables (which are 1-1 relation):

Customer (id*, name)
CustomerDetails (id*, comments)

and a class
Customer {
int id;
String name;
String comments;
}
I know, db schema is not 'right', but we can not change that.
Appreciate for any comments.
[ August 17, 2004: Message edited by: Igor Semenko ]