Need Help Forming A Query In Jooq

18 views
Skip to first unread message

Debapriya Patra

unread,
Jun 14, 2021, 8:01:04 PM6/14/21
to jOOQ User Group
Hi,

Can someone help me forming a query in jooq which I wrote in MySql?
Here is my MySql query and wanted to convert the same in Jooq.

select * from edu_content where id in ("03bb84c5-0516-44e3-8445-ba0d8dba32e9", "050a30fd-b1c3-4767-b453-8cc2d211049b", "2941b14c-135a-4866-89e1-e9a43aa368c5", "2bc7ffbc-1704-49cb-b28b-b324577598a8", "ff6847ac-3a18-4609-8e1b-7dae5ba1e297") order by field (content_status, 'PAID', 'PAYOUT_INITIATED', 'PENDING_VERIFICATION', 'SYLLABUS_REQUIRED', 'NEED_MORE_INFO'), updated_ts asc;

Thanks In Advance.

Thanks,
Deba

Rob Sargent

unread,
Jun 14, 2021, 8:05:22 PM6/14/21
to jooq...@googlegroups.com
What have you tried?


Debapriya Patra

unread,
Jun 14, 2021, 9:19:35 PM6/14/21
to jOOQ User Group
This is what I have done following this link.


dsl.select(
EDU_CONTENT.ID,
EDU_CONTENT.TITLE,
EDU_CONTENT.DESCRIPTION,
EDU_CONTENT.MEDIA_TYPE,
EDU_CONTENT.EDU_DOCUMENT_TYPE,
EDU_CONTENT.CONTENT_STATUS,
EDU_CONTENT.CUSTOM_DOCUMENT_TYPE,
EDU_CONTENT.ORIGINAL_FILE_S3_URL,
EDU_CONTENT.PREVIEW_FILE_S3_URL,
EDU_CONTENT.THUMBNAIL_FILE_S3_URL,
EDU_CONTENT.CREATED_TS,
EDU_CONTENT.UPDATED_TS,
EDU_CONTENT.EXAM_NAME,
EDU_CONTENT.YEAR,
EDU_CONTENT.TERM,
EDU_CONTENT.COMMENT,
EDU_CONTENT.DELETED,
EDU_CONTENT.NUM_PAGES)
.from(EDU_CONTENT)
.where(EDU_CONTENT.ID.in(eduContentIds))
.orderBy(EDU_CONTENT.CONTENT_STATUS.sortAsc(NEED_MORE_INFO, PENDING_VERIFICATION, PAYOUT_INITIATED, PAID, SYLLABUS_REQUIRED),
EDU_CONTENT.UPDATED_TS.asc()).limit(50).fetchInto(EduContent.class);

Rob Sargent

unread,
Jun 14, 2021, 11:04:24 PM6/14/21
to jooq...@googlegroups.com
and the error is?
I assume "eduContentIds" is a collection of the right type.
Are you assigning to a Collection<EduContent>?


 

Lukas Eder

unread,
Jun 15, 2021, 2:09:53 AM6/15/21
to jOOQ User Group
What's not working?

--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/35c7b1e2-346f-4517-9683-b78c71472e12n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages