1 19 20 21 package org.apache.cayenne.jpa.map; 22 23 import javax.persistence.JoinColumn; 24 25 31 public class JpaJoinColumn { 32 33 protected String name; 34 protected String referencedColumnName; 35 protected boolean unique; 36 protected boolean nullable; 37 protected boolean insertable; 38 protected boolean updatable; 39 protected String columnDefinition; 40 protected String table; 41 42 public JpaJoinColumn() { 43 44 } 45 46 public JpaJoinColumn(JoinColumn annotation) { 47 if (!"".equals(annotation.name())) { 48 name = annotation.name(); 49 } 50 51 if (!"".equals(annotation.referencedColumnName())) { 52 referencedColumnName = annotation.referencedColumnName(); 53 } 54 55 if (!"".equals(annotation.columnDefinition())) { 56 columnDefinition = annotation.columnDefinition(); 57 } 58 59 if (!"".equals(annotation.table())) { 60 table = annotation.table(); 61 } 62 63 unique = annotation.unique(); 64 nullable = annotation.nullable(); 65 insertable = annotation.insertable(); 66 updatable = annotation.updatable(); 67 } 68 69 public String getColumnDefinition() { 70 return columnDefinition; 71 } 72 73 public void setColumnDefinition(String columnDefinition) { 74 this.columnDefinition = columnDefinition; 75 } 76 77 public boolean isInsertable() { 78 return insertable; 79 } 80 81 public void setInsertable(boolean insertable) { 82 this.insertable = insertable; 83 } 84 85 public String getName() { 86 return name; 87 } 88 89 public void setName(String name) { 90 this.name = name; 91 } 92 93 public boolean isNullable() { 94 return nullable; 95 } 96 97 public void setNullable(boolean nullable) { 98 this.nullable = nullable; 99 } 100 101 public String getReferencedColumnName() { 102 return referencedColumnName; 103 } 104 105 public void setReferencedColumnName(String referencedColumnName) { 106 this.referencedColumnName = referencedColumnName; 107 } 108 109 public String getTable() { 110 return table; 111 } 112 113 public void setTable(String table) { 114 this.table = table; 115 } 116 117 public boolean isUnique() { 118 return unique; 119 } 120 121 public void setUnique(boolean unique) { 122 this.unique = unique; 123 } 124 125 public boolean isUpdatable() { 126 return updatable; 127 } 128 129 public void setUpdatable(boolean updateable) { 130 this.updatable = updateable; 131 } 132 } 133 | Popular Tags |