- Posted by: Rajarshi Ghosh
- Posted on: June 07 2005 09:57 EDT
I have two database tables say TAB1, TAB2.
There are two ejbs for TAB1(EJB1)and TAB2(EJB2). EJB1 gives me a java.util.List of custom Person object. EJB2 also gives a java.util.List of custom Person object.
List1 and List2 has some Person objects common. I need to compare these two List and need to create a new List which has unique of List1 and List2.
Can someone tell which is the best way to do this?
List 1and List2 has more than 3000 Person objects.
clone listA---calling listACloned
Answer is listACloned :-)
i mis read the question
just use removeAll on both the lists using the other one
I think it should be
Maybe out of context answer.. but why not simply do that in the DB and use a query/view (using a union-distinct) to publish the list in a new EJB?