Or you can execute the individual queries and add them to a HashSet, if you need to maintain unique elements (this requires overriding your equals and hashCode methods) or to a List if duplicates are allowed.
Query query1 = session.createQuery(first)
Query query2 = session.createQuery(second
List list1 = query1.list();
List list2 = query2.list();
List nonUnique = list1.add(list2);
HashSet unique = new HashSet(nonUnique);
Main Topics
Browse All Topics





by: objectsPosted on 2007-05-09 at 18:31:15ID: 19062239
it doesn't you'll need to use native sql