Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Please need help badly. Thanks in advance
I have 2 small classes: using map in association.
=================
public class Data {
private long dataId;
private String name;
private Date times;
private Map<String, VarValue> properties = new HashMap<String, VarValue>();
}
public class VarValue {
private long varId;
private String key;//key of the map;
private String value;
private int type;
}
===========
I map these classes to tables:
============
create table data (
id bigint generated by default as identify (start with 1),
times timestamp,
name varchar(10)
primary key(id)
)
create table varValue (
var_id bigint generated by default as identify (start with 1),
key varchar(10),
value varchar(10),
type int,
primary key(var_id),
constraint fk_data_id foreign key (var_id) references data(id),
)
===================
is it correct to map in this way?
Thanks in advance.