I have a situation where I need to map a one-to-(one or none). Is that possible in Hibernate (other than just using a one-to-many and always grabbing the first element in the Set)?
For example, if I have a table of a bunch of Person records and I want to have a foreign key field to say who is directly in front of each person in line (and who is behind each person), how would I do it?
Many thanks to any helpful idea givers,
Josh
P.S. Is it possible to say that a 'Set' on a one-to-many has a limited size? If so, I could use this feature and limit the set size to 1, I guess.
|