Hibernate version: 2 or 3
Mapping documents:
I have a unique system where there are not domain objects. all the objects are extended "xml-like-name-value objects"
I have various value objects:
Object1
Object2
Object3
My Object Model does not have Object1, 2, 3 but it has object and I store all the properties of the object in name and values for example
So the in-memory representation of Object1 will be
Name Value
URI uri:object1
Object1Prop1 true
And similarly Object2 will be
Name Value
URI uri:object2
Object2Prop1 true
Also the relationships Object1 - Object2 are stored seperately in the memory.
How will hibernate which requires one class per table persist these types of objects? I dont have a getter or setter since I dont have the objects at all. all objects are just name values pairs. I have to implement this type of design because of some business flexibility requirement
Based on the Value of these type of object, I would like to "route" them to respective tables. in short, I would like to havev data-based mapping, if the URI's value is uri:object1, persist in Object1 Table, if URI's value is uri:object2, persist in object2 table, and so on. and based on the relastionship, say object1- object2, persist the primary key foriegn key appropriately?
How will I achieve this using hibernate? can I do this in hhibernate?
|