Skip to content

Mapped SuperClass Support

chhavigangwal edited this page Oct 18, 2013 · 15 revisions

Introduction:

Mapped super class is used to define state and mapping information that is common to multiple entity classes.It is a super class which does not have any separate table.It is never be a part of persistent relationship and can be concrete or an abstract class. Kundera, being a JPA provider supports Mapped super class.

Why Support it ?

In order to become a stronger JPA provider Kundera has also enabled support of Mapped Superclasses.

Examples:

Mapped SuperClass :

@MappedSuperclass
@Table(name = "TRNX")
public class Transaction 
{

    @Id
    private String txId;
    
    @Column
    private String bankIdentifier;

    
    @Column
    private Date transactionDt;

Inheritance Strategy:

@Entity
@Table(name = "TRNX")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "tx_type")
public class Transaction extends AbstractTransaction
{
    
    @Column
    private String bankIdentifier;

No join table support enabled

Clone this wiki locally