Hibernate version: 3.2.6.ga
Mapping documents: no - annotations
Code between sessionFactory.openSession() and session.close(): y
Full stack trace of any exception that occurs: n/a
Name and version of the database you are using: Oracle 10g
The generated SQL (show_sql=true):n/a
Debug level Hibernate log excerpt: n/a
Hi all,
I'm attempting to figure out how to map to a legacy database schema and am out of ideas on how to perform this association
Here's a rough sketch of what I'm dealing with from an object level:
A
id
Map<String, String> info;
B
id
Map<String, String> info;
A is in its own table
B is in its own table
And info has a table similar to the following
obj_id, obj_type, field_name, field_value
The following assumptions are in play
obj_id would be an object ID of A or B
obj_type would be a discriminator value like "A_TYPE" or "B_TYPE"
field_name would be a "map key"
field_value would be a "map value" associated with field_name
obj_id, obj_type, field_name are a composite key for the table
What I can't figure out is a clean way to map it to the A & B definitions defined earlier.
Any help would be appreciated.
Thanks.
--Dave
|