-->
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.  [ 2 posts ] 
Author Message
 Post subject: Urgent. Can i insert only Goods object and not Matrics ??
PostPosted: Fri Nov 12, 2004 1:44 am 
Newbie

Joined: Fri Nov 12, 2004 1:40 am
Posts: 7
hi all

i have a Goods object as follows :

class Goods
{
String name;
String id;//id
Metric m;//another object
}

and Metric is :

class Metric
{

String name;
String id;//id
}

Metric table is already filled in database. i just have instances
of Goods to be written into its table without writing Metrics into Metrics table. in Goods table i just have a field for metric as forigen key. i just want this field to be written.i dont want any touch of metrics table.

Is this possible ? if the answer is YES then i can choose whether to use hibernate or not.
thax


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 12, 2004 3:12 am 
Expert
Expert

Joined: Thu Jan 29, 2004 2:31 am
Posts: 362
Location: Switzerland, Bern
Just map them as a unique foreign key association. See chapter 5.1.11 of the reference documentation.

HTH
Ernst


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

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.