1

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 Answer 1

3

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;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.