How can I make a many-to-one xml mapping from the stayId of RoomOccupancy to the stayId of Stay. Note that StayId is a value object, therefore it does not contain the whole reference to Stay.
public class RoomOccupancy {
// generated hibernate id
private Long id;
private LocalDate startDate;
private LocalDate endDate;
private StayId stayId;
}
public class Stay {
// generated hibernate id
private Long id;
private StayId stayId;
}
I would be very glad, if someone could help me out.Thank you in Advance!