1 21 package oracle.toplink.essentials.internal.ejb.cmp3.metadata.columns; 23 24 import java.util.ArrayList ; 25 import java.util.List ; 26 27 import javax.persistence.JoinColumn; 28 import javax.persistence.JoinColumns; 29 30 36 public class MetadataJoinColumns { 37 protected List <MetadataJoinColumn> m_joinColumns; 38 39 42 public MetadataJoinColumns() { 43 m_joinColumns = new ArrayList <MetadataJoinColumn>(); 44 } 45 46 49 public MetadataJoinColumns(JoinColumns joinColumns, JoinColumn joinColumn) { 50 this(); 51 52 if (joinColumns != null) { 54 for (JoinColumn jColumn : joinColumns.value()) { 55 m_joinColumns.add(new MetadataJoinColumn(jColumn)); 56 } 57 } 58 59 if (joinColumn != null) { 61 m_joinColumns.add(new MetadataJoinColumn(joinColumn)); 62 } 63 } 64 65 68 public MetadataJoinColumns(JoinColumn[] joinColumns) { 69 this(); 70 71 for (JoinColumn joinColumn : joinColumns) { 72 m_joinColumns.add(new MetadataJoinColumn(joinColumn)); 73 } 74 } 75 76 79 public boolean loadedFromXML() { 80 return false; 81 } 82 83 86 public int size() { 87 return m_joinColumns.size(); 88 } 89 90 93 public List <MetadataJoinColumn> values() { 94 if (m_joinColumns.isEmpty()) { 96 m_joinColumns.add(new MetadataJoinColumn()); 97 } 98 99 return m_joinColumns; 100 } 101 } 102 | Popular Tags |