jooq sensitive data automatically encryption and decryption

304 views
Skip to first unread message

5548...@qq.com

unread,
Apr 11, 2021, 11:25:45 PM4/11/21
to jOOQ User Group
I want to encrypt a few sensitive data like telno or  password in database. And when I query these data from database, I expect that these data will be decrypt to plaintext.

When using Mybatis, I can use a custom Typehandler to do this job. Does jOOQ supports them?  I looked up in User Manual ,  converter maybe the solution, but it's global-wide and the types of U and T suppose to be different. So I can't figure out a way to do this. 

Lukas Eder

unread,
Apr 13, 2021, 10:48:49 AM4/13/21
to jOOQ User Group
Hello,

Both jOOQ Converter and Binding types can be used for this. They're not "global". You'll be attaching either to specific columns using the code generator, see:

Just because a type Converter<T, U> offers two distinct type variables, there's no such requirement as for those type variables to be bound to distinct types. You can obviously create a Converter<String, String> and attach that to any VARCHAR column.

I hope this helps,
Lukas

On Mon, Apr 12, 2021 at 5:25 AM 5548...@qq.com <5548...@qq.com> wrote:
I want to encrypt a few sensitive data like telno or  password in database. And when I query these data from database, I expect that these data will be decrypt to plaintext.

When using Mybatis, I can use a custom Typehandler to do this job. Does jOOQ supports them?  I looked up in User Manual ,  converter maybe the solution, but it's global-wide and the types of U and T suppose to be different. So I can't figure out a way to do this. 

--
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/cac924af-b7ed-455c-b07b-09d1f3b224d8n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages