简体   繁体   中英

Hibernate List<String> Java Persistence 1.0

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 .

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;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM