-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: table mapping problems
PostPosted: Wed Oct 18, 2006 3:23 am 
Newbie

Joined: Tue Oct 17, 2006 2:50 pm
Posts: 4
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.