-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: CollectionOfElement containing long ids
PostPosted: Sat Apr 04, 2009 12:02 pm 
Newbie

Joined: Wed Feb 11, 2009 7:18 pm
Posts: 1
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.