Hibernate List<String> Java Persistence 1.0

362 Views Asked by At

I seem to have problems with mapping a List in Hibernate. In our project there is a class Profile, it contains a List<String>.

Is List<String> mappable by Hibernate using annotations, using Java Persistence 1.0 (NO ElementCollection!)? (annotations like @Entity)

I know that Java Persistence 2.0 consists of ElementCollection, but in our project we have only Java Persistence 1.0.

1

There are 1 best solutions below

0
On

There is nothing like that in JPA 1. You have to fallback to Hibernate specific annotation and use CollectionOfElements instead:

@org.hibernate.annotations.CollectionOfElements 
List<String> myElements;