Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » strange Persistence exception with a List type(get exception when defining a class field whose type is List<-some entity type>)
strange Persistence exception with a List type [message #790175] Fri, 03 February 2012 22:53
Patricia Goldweic is currently offline Patricia GoldweicFriend
Messages: 34
Registered: October 2010
Member
My code runs into the following exception:
-----------------------------------------------------------------------
Internal Exception: Exception [EclipseLink-7203] (Eclipse Persistence Services - 2.0.0.v20091127-r5931): org.eclipse.persistence.exceptions.ValidationException
Exception Description: The mapping element [communities] for the class [class edu.northwestern.at.teams.persistence.Person] has an unsupported collection type [class java.util.List]. Only Set, List, Map and Collection are supported.
------------------------------------------------------------------------
when the Persistence unit is being loaded. The class in question has a field as follows:

/** A list of communities a person participates in */
@OneToMany
@JoinTable
(
name="person_community",
joinColumns= @JoinColumn(name="personId", referencedColumnName="id"),
inverseJoinColumns= @JoinColumn(name="communityId", referencedColumnName="id")
)
private List<Community> communities;

Where both Person and Community are Entity types. Why is the exception being thrown, given that I am using a List<Community> type, and List is supposed to be a supported type, as even the error message suggests?
Previous Topic:MOXy: xml-mapping-metadata-complete problem
Next Topic:org.eclipse.persistence.exceptions.ValidationException
Goto Forum:
  


Current Time: Thu Nov 27 18:23:17 GMT 2014

Powered by FUDForum. Page generated in 0.04019 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software