-->
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: Parent/Child relationships
PostPosted: Mon Jun 02, 2008 2:58 am 
Newbie

Joined: Mon Jun 02, 2008 2:42 am
Posts: 1
Hi,

I'm testing a JPA project in eclipse to connect to a legacy database. The tables are purchaseOrderHdr and purchaseOrderLine. Now the tables both have a decimal field (ref) with a unique index on it. (that is the primary key as such.) This is also the foriegn key for the lines table.

Looking at setting up a one to many relationship. Can I map this column as an @ID and also @OneToMany? The eclipse GUI only supports one map as option.

@Entity
public class purchaseOrderHdr implements Serializable {
@Id
@OneToMany
private BigDecimal phintref;
}

Thanks
David


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.