Last active
April 4, 2018 14:55
-
-
Save JamesZoft/69a7a40ce574e7f5ca9b689de7ada5dd to your computer and use it in GitHub Desktop.
This file contains 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
List<Container> containers = session.createNativeQuery("select * from containers c", Container.class) | |
.list(); | |
containers.forEach(container -> { | |
SubEntity subEntity = session.createNativeQuery("select * from subEntity se join containers c on se.id = c.fk_se where c.id = :id") | |
.setParameter("id", container.getId()) | |
.uniqueResult(); | |
container.setSubEntity(subEntity); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment