Hey,
As I map my classes to a flex fronted with blazeds I want to send only objects that hold not the reference to another object only a set with the ids, so I can look them up when I need them.
Otherwise it would get a bit inconsitent when de/serializing objects to a client several time.
Code:
public class Event {
private Long eventId;
private Set<Long> invitedPersonIds;//contains all ids to persons that are invited
private Long hostId; //holds the id of the host person
//getters & setters.....
}
Code:
public class Person {
private Long personId;
private String name;
//getters & setters.....
}
Is there anyway how to keep the integrity constraint. For example if a invited person gets deleted, that it gets removed from the set.
I guess one idea would be to have a second package that models the usual way with
Code:
... private Set<Person> invitedPersons...
and map it to the same tables or is there an easier way?
Thanks in advance
Max