1 21 package oracle.toplink.essentials.internal.ejb.cmp3.metadata.tables; 23 24 import javax.persistence.JoinColumn; 25 import javax.persistence.JoinTable; 26 27 import oracle.toplink.essentials.internal.ejb.cmp3.metadata.columns.MetadataJoinColumns; 28 29 35 public class MetadataJoinTable extends MetadataTable { 36 private JoinColumn[] m_joinColumns; 37 private JoinColumn[] m_inverseJoinColumns; 38 protected MetadataJoinColumns m_jColumns; 39 protected MetadataJoinColumns m_inverseJColumns; 40 41 44 public MetadataJoinTable() { 45 m_joinColumns = new JoinColumn[] {}; 46 m_inverseJoinColumns = new JoinColumn[] {}; 47 } 48 49 52 public MetadataJoinTable(JoinTable joinTable) { 53 this(); 54 55 if (joinTable != null) { 56 m_name = joinTable.name(); 57 m_schema = joinTable.schema(); 58 m_catalog = joinTable.catalog(); 59 m_joinColumns = joinTable.joinColumns(); 60 m_inverseJoinColumns = joinTable.inverseJoinColumns(); 61 62 processName(); 63 processUniqueConstraints(joinTable.uniqueConstraints()); 64 } 65 } 66 67 70 public MetadataJoinColumns getInverseJoinColumns() { 71 if (m_inverseJColumns == null) { 72 m_inverseJColumns = processInverseJoinColumns(); 73 } 74 75 return m_inverseJColumns; 76 } 77 78 81 public MetadataJoinColumns getJoinColumns() { 82 if (m_jColumns == null) { 83 m_jColumns = processJoinColumns(); 84 } 85 86 return m_jColumns; 87 } 88 89 92 public boolean loadedFromXML() { 93 return false; 94 } 95 96 99 protected MetadataJoinColumns processInverseJoinColumns() { 100 return new MetadataJoinColumns(m_inverseJoinColumns); 101 } 102 103 106 protected MetadataJoinColumns processJoinColumns() { 107 return new MetadataJoinColumns(m_joinColumns); 108 } 109 } 110 | Popular Tags |