-->
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: (Why) do I need to map my @OneToOne as a @OneToMany?
PostPosted: Thu Jan 10, 2008 11:16 am 
Regular
Regular

Joined: Thu Oct 13, 2005 4:19 am
Posts: 98
I have a legacy database with a table X and a table Y.
There's a constraint between X and Y on X.code and Y.code.
There multiple Y's with the same code.
A Y.code together with Y.region is unique.

I'd like to make a @OneToOne relation from X to Y, with the where clause constraints "X.code = Y.code" and "Y.region = :myRegion", which guarantees that X to Y is a *ToOne relation. That ":myRegion" is a runtime parameter.

However it looks like it's impossible to map X to Y as a *ToOne relation in JPA-Hibernate because at configuration time it can't see that it's a ToOne relation? Or is it possible?

Thanks for any help :)

_________________
http://www.ohloh.net/accounts/ge0ffrey


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.