using Hibernate you can do
@ElementCollection(targetElement = InterestsEnum.class)
@JoinTable(name = "tblInterests", joinColumns = @JoinColumn(name = "personID"))
@Column(name = "interest", nullable = false)
@Enumerated(EnumType.STRING)
Collection<InterestsEnum> interests;
More Related Contents:
- What’s the difference between JPA and Hibernate? [closed]
- Can someone explain mappedBy in JPA and Hibernate?
- Why does JPA have a @Transient annotation?
- How to create and handle composite primary key in JPA
- When to use EntityManager.find() vs EntityManager.getReference() with JPA
- Please explain about insertable=false and updatable=false in reference to the JPA @Column annotation
- @PreUpdate and @Prepersist in hibernate/JPA (using session)
- Hibernate bidirectional @ManyToOne, updating the not owning side not working
- No Persistence provider for EntityManager named X
- MappedSuperclass – Change SequenceGenerator in Subclass
- persistence.xml different transaction-type attributes
- JPA Multiple Embedded fields
- Sharing a persistence unit across components in a .ear file
- Difference between a “jta-datasource” and a ” resource-local ” datasource?
- PersistenceUnit vs PersistenceContext
- LOAD and CACHE application-scoped data with @Singleton and @Stateless
- What’s the difference between the IN and MEMBER OF JPQL operators?
- How to create join table with JPA annotations?
- How to auto detect entities in JPA 2.0
- JPA: difference between @JoinColumn and @PrimaryKeyJoinColumn?
- When and why JPA entities should implement the Serializable interface?
- Handling soft-deletes with Spring JPA
- Getting Database connection in pure JPA setup
- Hibernate/JPA – annotating bean methods vs fields [duplicate]
- Java EE 6 vs. Spring 3 stack [closed]
- How to introduce multi-column constraint with JPA annotations?
- Are you supposed to have one repository per table in JPA?
- Spring security’s SecurityContextHolder: session or request bound?
- How to deploy a Java Web Application (.war) on tomcat?
- EAR vs separate EJB + WAR