Skip to content

Instantly share code, notes, and snippets.

@springcome
Last active November 24, 2015 01:48
Show Gist options
  • Save springcome/dc9ff782822c2b3c20bf to your computer and use it in GitHub Desktop.
Save springcome/dc9ff782822c2b3c20bf to your computer and use it in GitHub Desktop.
Querydsl .in()
/**
* select *
* from single s
* where s.cd in (select g.cd from group g where g.grp_cd = 'GRP_CD'))
* /
public List<Single> getList(String grpCd) {
QSingle s = QSingle.single;
QGroup g = QGroup.group;
return select().from(s).where(
s.cd.in(subquery().from(g).where(g.grpCd.eq(grpCd)).list(g.cd))
).list(s);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment