Thanks for your message.

There isn't any reliable way to map an EAV (Entity Attribute Value) table
in a type safe manner, because the whole point of an EAV table is to remove
type safety by applying denormalisation. I personally advise against using
EAV in most cases (with some exceptions), but you may have your reasons.

I hope this helps,
Lukas

On Wed, May 15, 2019 at 5:36 PM Raghavan Lakshmana <[email protected]> wrote:

> 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
> <https://groups.google.com/d/msgid/jooq-user/99e41715-2f3a-4983-9c32-6e929e598543%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAB4ELO5MZ05OE%2BWKp1ARPiY_cQk1rPSw67d%2BwRXvCxH2HX3EqA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to