1 19 20 package org.apache.cayenne.jpa.map; 21 22 import java.util.ArrayList ; 23 import java.util.Collection ; 24 25 import org.apache.cayenne.util.TreeNodeChild; 26 27 32 public class JpaEntity extends JpaAbstractEntity { 33 34 protected String name; 35 protected JpaTable table; 36 protected JpaInheritance inheritance; 37 protected String discriminatorValue; 38 protected JpaDiscriminatorColumn discriminatorColumn; 39 protected JpaSequenceGenerator sequenceGenerator; 40 protected JpaTableGenerator tableGenerator; 41 protected JpaSqlResultSetMapping sqlResultSetMapping; 42 protected Collection <JpaAttributeOverride> attributeOverrides; 43 protected Collection <JpaAssociationOverride> associationOverrides; 44 45 protected Collection <JpaNamedQuery> namedQueries; 49 protected Collection <JpaNamedNativeQuery> namedNativeQueries; 50 51 protected Collection <JpaSecondaryTable> secondaryTables; 52 protected Collection <JpaPrimaryKeyJoinColumn> primaryKeyJoinColumns; 53 54 public String getName() { 55 return name; 56 } 57 58 public void setName(String name) { 59 this.name = name; 60 } 61 62 @TreeNodeChild 63 public JpaDiscriminatorColumn getDiscriminatorColumn() { 64 return discriminatorColumn; 65 } 66 67 public void setDiscriminatorColumn(JpaDiscriminatorColumn discriminatorColumn) { 68 this.discriminatorColumn = discriminatorColumn; 69 } 70 71 85 public String getDiscriminatorValue() { 86 return discriminatorValue; 87 } 88 89 public void setDiscriminatorValue(String discriminatorValue) { 90 this.discriminatorValue = discriminatorValue; 91 } 92 93 @TreeNodeChild 94 public JpaInheritance getInheritance() { 95 return inheritance; 96 } 97 98 public void setInheritance(JpaInheritance inheritance) { 99 this.inheritance = inheritance; 100 } 101 102 @TreeNodeChild 103 public JpaSequenceGenerator getSequenceGenerator() { 104 return sequenceGenerator; 105 } 106 107 public void setSequenceGenerator(JpaSequenceGenerator sequenceGenerator) { 108 this.sequenceGenerator = sequenceGenerator; 109 } 110 111 @TreeNodeChild 112 public JpaSqlResultSetMapping getSqlResultSetMapping() { 113 return sqlResultSetMapping; 114 } 115 116 public void setSqlResultSetMapping(JpaSqlResultSetMapping sqlResultSetMapping) { 117 this.sqlResultSetMapping = sqlResultSetMapping; 118 } 119 120 @TreeNodeChild 121 public JpaTable getTable() { 122 return table; 123 } 124 125 public void setTable(JpaTable table) { 126 this.table = table; 127 } 128 129 @TreeNodeChild 130 public JpaTableGenerator getTableGenerator() { 131 return tableGenerator; 132 } 133 134 public void setTableGenerator(JpaTableGenerator tableGenerator) { 135 this.tableGenerator = tableGenerator; 136 } 137 138 142 @TreeNodeChild(type = JpaAttributeOverride.class) 143 public Collection <JpaAttributeOverride> getAttributeOverrides() { 144 if (attributeOverrides == null) { 145 attributeOverrides = new ArrayList <JpaAttributeOverride>(); 146 } 147 148 return attributeOverrides; 149 } 150 151 @TreeNodeChild(type = JpaAssociationOverride.class) 152 public Collection <JpaAssociationOverride> getAssociationOverrides() { 153 if (associationOverrides == null) { 154 associationOverrides = new ArrayList <JpaAssociationOverride>(); 155 } 156 157 return associationOverrides; 158 } 159 160 @TreeNodeChild(type = JpaNamedNativeQuery.class) 161 public Collection <JpaNamedNativeQuery> getNamedNativeQueries() { 162 if (namedNativeQueries == null) { 163 namedNativeQueries = new ArrayList (); 164 } 165 return namedNativeQueries; 166 } 167 168 @TreeNodeChild(type = JpaNamedQuery.class) 169 public Collection <JpaNamedQuery> getNamedQueries() { 170 if (namedQueries == null) { 171 namedQueries = new ArrayList (); 172 } 173 return namedQueries; 174 } 175 176 181 @TreeNodeChild(type = JpaPrimaryKeyJoinColumn.class) 182 public Collection <JpaPrimaryKeyJoinColumn> getPrimaryKeyJoinColumns() { 183 if (primaryKeyJoinColumns == null) { 184 primaryKeyJoinColumns = new ArrayList (); 185 } 186 return primaryKeyJoinColumns; 187 } 188 189 @TreeNodeChild(type = JpaSecondaryTable.class) 190 public Collection <JpaSecondaryTable> getSecondaryTables() { 191 if (secondaryTables == null) { 192 secondaryTables = new ArrayList (); 193 } 194 return secondaryTables; 195 } 196 197 @Override 198 public String toString() { 199 return "JpaEntity:" + name; 200 } 201 } 202 | Popular Tags |