You can just use a many to one with unique set to true like this:

@hibernate.many-to-one column="deviceId" unique="true" lazy="false"
on my getDevice() method

Its a constrained many to one where you can really only have one of these for 
each deviceId.

----- Original Message ----
From: hquinn <[EMAIL PROTECTED]>
To: users@appfuse.dev.java.net
Sent: Wednesday, February 21, 2007 12:31:39 PM
Subject: [appfuse-user] hibernate relationship one-to-tone


Greetings everyone! 
Does anyone know how to do a relationship one-to-one? I'm working with
appfuse w/spring... and I've done relationships many-to-one or one-to-many a
lot of times, but now I need a relationship one-to-one ... I've read the
XDoclet API to see how to do one.. but I don't quite understand the
"constrained" parameter that much... how do I know if the relationship it
was created correctly?? 
Thank you very much..
-- 
View this message in context: 
http://www.nabble.com/hibernate-relationship-one-to-tone-tf3269093s2369.html#a9088523
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





Reply via email to