Skip to content

Instantly share code, notes, and snippets.

@jklingsporn
Last active August 30, 2017 09:51
Show Gist options
  • Save jklingsporn/3a940a82190ba266f63be524bbca4adb to your computer and use it in GitHub Desktop.
Save jklingsporn/3a940a82190ba266f63be524bbca4adb to your computer and use it in GitHub Desktop.
Record into Map
public class SomeJsonTest {
public void getJsonFromRecord2(){
SomethingDao somethingDao = new SomethingDao();
CompletableFuture<JsonObject> jsonFuture = somethingDao.executeAsync(dslContext -> dslContext
.select(Tables.SOMETHING.SOMEID)
.select(Tables.SOMEOTHERTHING.SOMEVALUE)
.join(Tables.SOMEOTHERTHING)
.on(Tables.SOMETHING.SOMEID.eq(Tables.SOMEOTHERTHING.SOMEOTHERID))
.where(Tables.SOMETHING.SOMEID.eq(1))
.fetchOneMap())
//or .fetchOne(Record::intoMap)
.thenApply(JsonObject::new);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment