Hello,
I have the following situation: I have two tables with one-to-one relation (by pk). Now I would like the first table to be mapped normally - to some class, but the second one to be mapped to a java.util.Map field in the first class.
So such situation is needed:
class User {
private long id;
private String name;
private Map params;
}
Where User is mapped to User table:
create table User (id long primary key, name varchar)
And User.params contains a column_name:value of user's params table:
create table UsersParams (id long primary key, age integer, height integer, ...)
How can I achieve it in hibernate? Is there any way?
Thanks in advance for any help.
|