This annotation specifies the secondary table in the entity class.
This annotation is specified when the entity class is mapped in multiple tables of the database.
When @SecondaryTable is not specified within the entity class, all persistence properties or persistence fields of the entity class will be mapped to the tables specified in the primary table.
The applicable target is class.
The following table lists the elements of @SecondaryTable:
Element name | Optional/Required | Element description |
---|---|---|
name | Required | This element specifies the secondary table name. |
catalog | Optional | This element specifies the catalog name of the secondary table. Note that Cosminexus JPA provider does not support this attribute. |
schema | Optional | This element specifies the schema name of the secondary table. |
pkJoinColumns | Optional | This element specifies the external key column used to bind the secondary table to the primary table. |
uniqueConstraints | Optional | This element specifies the unique key constraints in the table. Note that Cosminexus JPA provider does not support this attribute. |
The details of attributes that are supported with Cosminexus JPA provider are as follows: