Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert Record to Table Record in JOOQ?

Tags:

java

sql

jooq

I need to convert JOOQ's Result set of Record to a List of Table Record. Is there any method to do so?

like image 970
user1900723 Avatar asked Oct 22 '22 19:10

user1900723


1 Answers

Yes, you can use Result.into(Table). An example:

Result<?> result = create.fetch(...);
Table<MyRecord> MY_TABLE = ...
Result<MyRecord> other = result.into(MY_TABLE);

As Result implements List, this should do what you need

like image 105
Lukas Eder Avatar answered Nov 01 '22 09:11

Lukas Eder