Skip to content

Instantly share code, notes, and snippets.

@ironpeace
Created August 27, 2012 03:26
Show Gist options
  • Save ironpeace/3485276 to your computer and use it in GitHub Desktop.
Save ironpeace/3485276 to your computer and use it in GitHub Desktop.
Use 'IN' with JPA on Playframework1.2.5
List<Long> gids = new ArrayList<Long>();
for(Grp g: myGrps){
gids.add(g.id);
}
List<Entry> allE = Entry.em().createQuery("SELECT E FROM Entry E WHERE E.group.id IN (:groupid)").setParameter("groupid",gids).getResultList();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment