If this is a duplicate, I appologize. My post yesterday seems to have been lost. A search for posts by me shows none.
Hibernate version: 3.1.3
Name and version of the database you are using: Mysql 5.0.4
I'd like to be able to map the following class to the following schema. I realize it is not the standard normalized mapping. It is however the requirement.
Code:
class Parent {
long id; // id for hibernate
long my_id; // our unique id
Map<String,String> nameValuePairs;
}
Code:
table: parent
columns: id, my_id, map_key, map_value
Concrete example:
Code:
Parent {
id=1,
my_id=2,
nameValuePairs={a:va, b:vb}
}
would be stored as:
Code:
id my_id map_key map_value
1 2 a va
1 2 b vb
We can go through a Set<Map.Entry<String,String>> if necessary.
Thanks
Chris