Motivated by this question, I've tried to change the following:
@ManyToMany(cascade={CascadeType.REMOVE, CascadeType.MERGE})
private Set<Expression> exps = new LinkedHashSet<Expression>();
to:
@ManyToMany(cascade={CascadeType.REMOVE, CascadeType.MERGE})
private LinkedHashSet<Expression> exps = new LinkedHashSet<Expression>();
However, such a move results in:
Exception [EclipseLink-1] (Eclipse Persistence Services - 2.1.0.v20100614-r7608): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: The attribute [exps] is not declared as type ValueHolderInterface, but its mapping uses indirection. Mapping: org.eclipse.persistence.mappings.ManyToManyMapping[exps] Descriptor: RelationalDescriptor(com.mysimpatico.memoplatform.persistence.entities.Meaning --> [DatabaseTable(MEANING)])
How am I supposed in JPA2 to achieve the desired behavior?