1 21 package oracle.toplink.essentials.internal.ejb.cmp3.metadata.tables; 23 24 import javax.persistence.SecondaryTable; 25 import javax.persistence.PrimaryKeyJoinColumn; 26 27 import oracle.toplink.essentials.internal.ejb.cmp3.metadata.columns.MetadataPrimaryKeyJoinColumns; 28 29 35 public class MetadataSecondaryTable extends MetadataTable { 36 private PrimaryKeyJoinColumn[] m_pkJoinColumns; 37 protected MetadataPrimaryKeyJoinColumns m_primaryKeyJoinColumns; 38 39 42 public MetadataSecondaryTable() { 43 m_primaryKeyJoinColumns = null; 44 } 45 46 49 public MetadataSecondaryTable(SecondaryTable secondaryTable) { 50 this(); 51 52 if (secondaryTable != null) { 53 m_name = secondaryTable.name(); 54 m_schema = secondaryTable.schema(); 55 m_catalog = secondaryTable.catalog(); 56 m_pkJoinColumns = secondaryTable.pkJoinColumns(); 57 58 processName(); 59 processUniqueConstraints(secondaryTable.uniqueConstraints()); 60 } 61 } 62 63 66 public MetadataPrimaryKeyJoinColumns getPrimaryKeyJoinColumns(String sourceTableName) { 67 if (m_primaryKeyJoinColumns == null) { 68 processPrimaryKeyJoinColumns(sourceTableName); 69 } 70 71 return m_primaryKeyJoinColumns; 72 } 73 74 77 protected void processPrimaryKeyJoinColumns(String sourceTableName) { 78 m_primaryKeyJoinColumns = new MetadataPrimaryKeyJoinColumns(m_pkJoinColumns, sourceTableName, m_databaseTable.getQualifiedName()); 79 } 80 } 81 | Popular Tags |