Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » BUG - @PrimaryKeyJoinColumns causes [EclipseLink-7223] when existing a composite primary key
BUG - @PrimaryKeyJoinColumns causes [EclipseLink-7223] when existing a composite primary key [message #1853065] Thu, 16 June 2022 11:50
Alfonso Luna is currently offline Alfonso LunaFriend
Messages: 14
Registered: March 2010
Junior Member
@Entity
@Table(name = "table_a")
@IdClass(ClassA_PK.class)
@Inheritance(strategy = InheritanceType.JOINED)
@DiscriminatorColumn(name = "discriminator_column", discriminatorType = DiscriminatorType.STRING)
public ClassA{
@Id String field1;
@Id String field2;
...
}


@Entity
@Table(name="table_b")
@DiscriminatorValue("TYPE_B")
@PrimaryKeyJoinColumns({
        @PrimaryKeyJoinColumn(name = "field1", referencedColumnName = "field1"),
        @PrimaryKeyJoinColumn(name = "field2", referencedColumnName = "field2")
})
public ClassB extends ClassA{
...
}



Exception [EclipseLink-7223] (Eclipse Persistence Services - 2.7.7.v20200504-69f2c2b80d): org.eclipse.persistence.exceptions.ValidationException
Exception Description: A @PrimaryKeyJoinColumns was found on the annotated element [class ClassB]. When the entity uses a single primary key, only a single (or zero) @PrimaryKeyJoinColumn should be specified.

Previous Topic:InheritanceType.JOINED not doing the correct JOIN with composite primary key
Next Topic:RollbackException on commit but transaction was successful.
Goto Forum:
  


Current Time: Sat Apr 27 02:33:43 GMT 2024

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

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

Back to the top