Which collections are permissible for javax.persistence.ManyToMany
Researching I found that javax.persistence.ManyToMany
relationship can be implemented various collection. I wonder if all java.util
collections are permissible or if there are restrictions.
Note that I actually use Scal开发者_运维问答a and I love to use one of the immutable collections. But I guess that is out of the question.
In the Hibernate Documentation it only says:
You can map Collection, List, Map and Set pointing to associated entities as one-to-many or many-to-many associations using the @OneToMany or @ManyToMany annotation respectively. If the collection is of a basic type or of an embeddable type, use @ElementCollection. We will describe that in more detail in the following subsections.
Source: http://docs.jboss.org/hibernate/annotations/3.5/reference/en/html/entity.html#entity-mapping-association-collections
精彩评论