Here's some sample code. Note that if @CollectionOfElements annotation is there, I get :
WARNING: com.sun.enterprise.deployment.backend.IASDeploymentException: java.util.ConcurrentModificationException
If I delete the annotation, then I get the following:
org.hibernate.MappingException: Could not determine type for: java.util.List, for columns: [org.hibernate.mapping.Column(partNumber)]
Code:
@Embeddable
public class SystemBoardType
implements Equals, HashCode, ToString {
@XmlTransient
protected List<String> partNumber;
@CollectionOfElements
public List<String> getPartNumber() {
if (partNumber== null) {
partNumber = new ArrayList<String>();
}
return this.partNumber;
}
public void setPartNumberList<String> partNumber {
this.partNumber = partNumber;
}
@Transient
public boolean isSetPartNumber() {
return ((this.partNumber!= null)&&(!this.partNumber.isEmpty()));
}
public void unsetPartNumber() {
this.partNumber = null;
}