Java Mailing List Archive

http://www.gg3721.com/

Home » users.openjpa »

List mapping of Enumerated Types

Patel Amit

2008-05-02

Replies: Find Java Web Hosting

Author LoginPost Reply
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

©2008 gg3721.com - Jax Systems, LLC, U.S.A.