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: One To Many- different name of primary and foreign key
PostPosted: Wed Jun 24, 2009 3:47 am 
Newbie

Joined: Thu May 14, 2009 10:34 am
Posts: 11
hi all,
I am in fix right now. Can anybody help me out? I want to know how to provide ONE To MANy mapping when, foreign Key and Primary key names in this relations are different.

i.e.
Code:
@Entity
public Class A{

@Column(name="B_FOREIGNKEY")
String bForKey;

@OneToMany
@JoinColumn("B_PRIMARYKEY")
List<B> blist;
}


@Entity
public Class B{

@Id
@Column(name="B_PRIMARYKEY")
String bPrimkey;
}


Is this Correct?? Sadly this is not working? Has, anybody have better idea???
Please help???


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.