I've been dealing with this for a few days now without success. I have a customer object with a collection of addresses. I'm mapped the usual one-to-many relationship successfully so that a customer has a set of addresses.
I also have a requirement where I need to only get the default address (marked with a flag on the address field) from the collection and map it to a seperate address property on the customer. I would like to do this in the mapping. I tried the example shown here:
http://www.onjava.com/pub/a/onjava/2005/08/03/hibernate.html?page=3 but it does not work at all. Does anyone have any other opproaches of returning just one item from a one-to-many collection.
Thank you very much