Match Queue Collections in JPA Hibernate

Is it possible to have the following collection mapping in JPA / hibernate

@OneToMany(cascade={CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE},
fetch=FetchType.LAZY,mappedBy="parent")

private Deque<Child> childrens;

It gives an error

Illegal attempt to map a non collection as a @OneToMany, @ManyToMany or @CollectionOfElements

I am using JPA 2.0 with Hibernate 3

+3
source share
2 answers

No, JPA does not support Deque. The JPA 2.0 specification explains this as follows:

, , , JavaBeans : java.util.Collection, java.util.Set, java.util.List [3], java.util.Map. . ( ) .

, Deque ( Deque ). - , (Thor84no).

+6

JPA Deque, Mikko, , ArrayDeque, .

@OneToMany(cascade={CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE},
fetch=FetchType.LAZY,mappedBy="parent")

private ArrayDeque<Child> childrens;
0

All Articles