Hello experts. Can anybody please help me. I have an entity -with a different table for each class in the hierarchy -an EmbeddedId class attribute -many-valued association with one-to-many multiplicity
I am getting "bad-unmapped-rel". <openjpa-2.1.1-SNAPSHOT-r422266:1087028 fatal user error> org.apache.openjpa.persistence.ArgumentException: Vous avez fourni des colonnes pour "com.sopra.evolan.collection.common.garantie.entity.GarantieJMV.listeGarantieJMVCreances", mais ce mappage ne permet pas de colonnes dans ce contexte. at org.apache.openjpa.jdbc.meta.MappingInfo.assertNoSchemaComponents(MappingInfo.java:382) This mapping is working in Hibernate. Thanks in advance for your help! eg @Entity @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) @NamedQueries({ @NamedQuery(name = GarantieJMV.LIST_BY_DOSSIER, query = "SELECT a FROM GarantieJMV a WHERE a.id.idetb=:idetb AND a.id.ndoss=:ndoss", @NamedQuery(name = GarantieJMV.LIST_BY_DOSSIER_WITH_GARANTIE_CREANCES, query = "SELECT a FROM GarantieJMV a LEFT JOIN FETCH a.listeGarantieJMVCreances WHERE a.id.idetb=:idetb AND a.id.ndoss=:ndoss") )}) public abstract class GarantieJMV implements IDatesCommunes, Serializable, IMultiEtablissement { @EmbeddedId private GarantieNID id; .... /** * GarantieJMVCreances associées */ @OneToMany(mappedBy = "garantieJMV", fetch = FetchType.LAZY, cascade = {CascadeType.ALL}) private Set<GarantieJMVCreance> listeGarantieJMVCreances; ...... Embeddable public class GarantieNID implements Serializable, Comparable<GarantieNID>, IMultiEtablissementNID { private static final long serialVersionUID = 1L; /** * Code établissement bancaire */ @Column(name = "IDETB", nullable = false, length = 5, columnDefinition = "char(5)") private String idetb; /** * Numéro de dossier */ @Column(name = "NDOSS") private Integer ndoss; /** * Identifiant garantie */ @Column(name = "IDGAR", nullable = false, length = 22, columnDefinition = "char(22)") private String idgar; ..... @Entity @Table(name = "PPJV3T") public class GarantieJMVCreance implements Serializable, IDatesCommunes { private static final long serialVersionUID = 1L; /** * Clé naturelle */ @EmbeddedId private GarantieCreanceNID id; .... @ManyToOne(fetch = FetchType.LAZY) @JoinColumns(value = { @JoinColumn(name = "IDETB", referencedColumnName = "IDETB", insertable = false, updatable = false), @JoinColumn(name = "NDOSS", referencedColumnName = "NDOSS", insertable = false, updatable = false), @JoinColumn(name = "IDGAR", referencedColumnName = "IDGAR", insertable = false, updatable = false)}) private GarantieJMV garantieJMV; .... -- View this message in context: http://openjpa.208410.n2.nabble.com/InheritanceType-TABLE-PER-CLASS-EmbeddedId-not-working-tp7581415.html Sent from the OpenJPA Users mailing list archive at Nabble.com.