I would like to seek help from this community on a problem I am trying to 
solve in my application which used jooq.


*I have posted this question on stackoverflow 
<https://stackoverflow.com/questions/56152926/how-to-store-enum-class-name-and-enum-value-in-database>.
 
Here is the post,*


I have a class with different enums, for example:


class EligibilityRule{ProductEligibility productEligibility;CountryEligibility 
countryEligibility}
enum ProductEligibility{
PRODUCT_X,
PRODUCT_Y}
enum CountryEligibility{
US,
IN,
CN..}


I want to store these enum class name and their value to database table 
called eligibility rule, and my table schema looks likes this,


String id  => auto_increment idString ruleType => enum class name (ex: 
ProductEligibility)String ruleValue => enum value (ex: PRODUCT_X)


I am using JOOQ, in the past I had used forced type to just store the enum 
value. But, in this case I want to store enum class name and enum value. I 
also want to reconstruct the enum object when I query the records from db.


Are there any patterns I can follow or is there any functionality in JOOQ 
which I can extend to solve this problem?

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jooq-user/99e41715-2f3a-4983-9c32-6e929e598543%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to