datanucleus-rdbms icon indicating copy to clipboard operation
datanucleus-rdbms copied to clipboard

Support JPA "MapsId"

Open andyjefferson opened this issue 8 years ago • 1 comments

AbstractMemberMetaData has "getMapsIdAttribute" from annotations/XML. Need to make use of it.

Could be useful if fully supporting '@EmbeddedId', for example

@Entity
public class Employee
{
    @Id 
    long id;
}
@Entity
@IdClass(DependentId.class)
public class Dependent
{
    @EmbeddedId
    DependentId id;

    @MapsId("employeePK")
    @ManyToOne 
    Employee employee;
}
@Embeddable
public class DependentId
{
    String name; // matches name of @Id attribute
    long employeePk; // matches type of Employee PK
    ...
}

andyjefferson avatar Apr 11 '16 08:04 andyjefferson

Note that this is strongly linked to an update to the enhancement contract in https://github.com/datanucleus/datanucleus-core/issues/155

andyjefferson avatar Jul 12 '17 07:07 andyjefferson