1 23 package org.objectweb.jorm.mapper.rdb.metainfo; 24 25 import org.objectweb.jorm.metainfo.lib.BasicMetaObject; 26 27 import java.util.ArrayList ; 28 import java.util.List ; 29 30 39 public class RdbJoin extends BasicMetaObject implements Comparable { 40 43 private ArrayList ptJoinColumnNames; 44 45 48 private ArrayList etJoinColumnNames; 49 50 private String name; 51 59 public RdbJoin(RdbExternalTable externalTable, String name) { 60 super(externalTable); 61 this.name = name; 62 this.ptJoinColumnNames = new ArrayList (); 63 this.etJoinColumnNames = new ArrayList (); 64 } 65 66 70 71 public RdbExternalTable getExternalTable() { 72 return (RdbExternalTable) parent; 73 } 74 75 80 public RdbTable getMainTable() { 81 return getExternalTable().getMainTable(); 82 } 83 89 public int compareTo(Object o) { 90 return name.compareTo(((RdbJoin) o).getName()); 91 } 92 93 101 public List getPTJoinColumnNames() { 102 return ptJoinColumnNames; 103 } 104 105 113 public List getETJoinColumnNames() { 114 return etJoinColumnNames; 115 } 116 117 120 public void addJoinColumnNames(String ptJoinColumnName, 121 String etJoinColumnName) { 122 if (! ptJoinColumnNames.contains( ptJoinColumnName)) { 123 if (! etJoinColumnNames.contains( etJoinColumnName)) { 124 ptJoinColumnNames.add(ptJoinColumnName); 125 etJoinColumnNames.add(etJoinColumnName); 126 } 127 } 128 } 129 130 public String getName() { 131 return name; 132 } 133 134 public void setName(String name) { 135 this.name = name; 136 } 137 } 138 | Popular Tags |