Philip,

You can probably do what you wish to accomplish by using the <one-to-one> tag within a class declaration:

http://hibernate.bluemars.net/hib_docs/reference/html_single/#or-mapping-s1- 9

An example of one-to-one can be found in the Author/Work example in the Hibernate documentation:

http://hibernate.bluemars.net/hib_docs/reference/html_single/#examples-s1

If this approach doesn't work (and you don't need <joined-subclass> object hierarchy across tables - which is a vertical, rather than horizontal mapping strategy), then you'll want to look into the Delegate pattern for object construction in Hibernate:

http://hibernate.bluemars.net/45.html

However, <one-to-one> probably does what you need...so try that first.

Good luck!

Les


St-Pierre Philip writes:


Hi everyone,
With Hibernate, we can map to classes to the same table, (eg. A
person object that has a reference to an address object, and the information
of both are saved to same table T_PERSON). But can I save a single object
across mutiple table. For example, if the person object is composed of is
personnal info (name, first name, age etc) and the information on is
location (address), and I want to save is personnal info on a T_PERSON table
and is location info on a T_ADDRESS table. How do I write the mapping file??
What are the tags that I need?


The point is that I have an existing database model and an object model,
both created by two different team, and i have to do the mapping between
them. This lead to many weird situations.


Thanks for your help.

Philip St-Pierre
Loto-Qu�bec - Projet IRIS (Centre de livraison)
Analyste-Programmeur
* [EMAIL PROTECTED]






------------------------------------------------------- This SF.net email is sponsored by: VM Ware With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0 _______________________________________________ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to