Forums Register Login

Mapping single class to multiple tables

+Pie Number of slices to send: Send
I'm interested to find out whether it's possible to map a single class to multiple tables using Hibernate.

e.g. mapping Employee.java to multiple tables such as PERSON [holds details such as name, employee id, etc] and CONTACT_DETAILS [holds info such as address, telephone number etc]

Looking through the reference hibernate documentation, I've come across the entity-name attribute, but am not sure how this fits in.

It's not possible to combine the tables into a single table and thereby exploit the 'component' feature, since this is the schema that's been dictated to us.

Thanks in advance,

regards,

Mo
+Pie Number of slices to send: Send
See the <join> mapping element.
+Pie Number of slices to send: Send
Edvins,
Thanks for that.
Mo
Every snowflake is perfect and unique. And every snowflake contains a very tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1892 times.
Similar Threads
CMP and Multiple Table Mappings
problem with resultset
Object mapping at runtime
Hibernate - Single Class to Multiple Tables
Hibernate object mapping for a view or multiple tables instead of a single table ?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 18:28:29.