-->
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: @ManyToOne with PrimaryKeyJoinColumn
PostPosted: Wed Jul 30, 2008 9:30 pm 
Regular
Regular

Joined: Fri Oct 05, 2007 3:22 am
Posts: 69
I'm trying to get around this lazy one to one loading issue using many to one.

@ManyToOne( cascade = CascadeType.ALL, fetch = FetchType.LAZY, optional = true )
@PrimaryKeyJoinColumn( name = "X_ID", referencedColumnName = "X_ID" )

Now, I don't have another column I can use to act as a join column for this specific entity and I have no control over the schema, I need to work with what I have.

So I'm trying to make use of the primary key to do this. I have tried using @JoinColumn with the primary key and this still doesn't result in lazy loading.

When I use the above configuration I constantly get it is looking for a the column thisEntity . targetEntityId should it not use the ones I specify instead of trying to derive it?


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.