Hello Jpa Community,

I have a question on how to annotate a Collection of enums in my Entity.

I have an Entity which has a List of Enums:

private List<KeyUsuage> keyUsuage = new ArrayList<KeyUsuage>();

Where KeyUsuage is the following enum:

public enum KeyUsuage
{
    digitalSignature,
    nonRepudiation,
    keyEncipherment,
    dataEncipherment,
    keyAgreement,
    keyCertSign,
    CRLSign,
    encipherOnly,
    decipherOnly,
    AllExtendedKeyUsage;
}

How do I go about mapping this to a table.  I imagine I do not need a
join table, but a child table that has the owner entity ID, Enumerated
String Value and a Sequence, but I do not know how to represent that in
a @OneToMany annotation.

Has anyone done this before or know how to do it?  Is this possible in
JPA?

Thanks for the help.

Amit

Reply via email to