-->
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: many-to-one in db but no reference in pojo
PostPosted: Wed Jun 09, 2004 12:41 pm 
Newbie

Joined: Wed Jun 09, 2004 12:24 pm
Posts: 1
Hi,

I would have a simple many-to-one mapping from Value to Measurement.
But I think it does not make sense to have a set of Values
in my Measurement class, because there are many (>10.000) and I
will only retrieve them via queries.
(Compare to Customer Cargo example in Domain-driven-design).

How should the hbm files look like?
How do I save a measurement through hibernate?

How do I specify with XDoclet/Hibernate that the values table contains a
foreign key to measurements table? My whole application relies on shemaexport,
so I would like to create also the values table automatically with the rest.

Using Hibernate 2.1

For clarification measurement should look like
public class Measurement{
String name;
}
_not_ like:
public class Measurement{
String name:
Set values;
}

Thanks for your answers

robert


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.