Last active
November 24, 2015 01:48
-
-
Save springcome/dc9ff782822c2b3c20bf to your computer and use it in GitHub Desktop.
Querydsl .in()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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