1 package com.instantbank.component.job.util; 2 3 import java.io.Serializable; 4 5 6 /** 7 * In memory representation of a system field of the current company 8 * (corresponding to table 9 * com.instantbank.common.utilcomponents.DatabaseNames.LETT_FIELD) 10 * 11 * @author InstantBank (Consuelo Franky) 12 * @created October 2002 13 */ 14 public class Field 15 implements Serializable { 16 17 /** 18 * unique code of field 19 */ 20 private long fieldId; 21 /** 22 * table alias associated to field 23 */ 24 private String tableAlias; 25 /** 26 * root type for joins: LetterTemplateGlobals.ROOT_AGREEMENTS 27 */ 28 private String rootType; 29 /** 30 * column name corresponding to field 31 */ 32 private String fieldColumn; 33 34 /** 35 * data type of field: 36 *LetterTemplateGlobals.FIELD_NUMERIC, FIELD_STRING, FIELD_DATE 37 */ 38 private String dataType; 39 40 /** 41 * code of associated value menu (optional: 42 *it can be LetterTemplateGlobals.UNDEF) 43 */ 44 private long menuId; 45 46 /** 47 * offset type of field (relevant for date fields): 48 * LetterTemplateGlobals.NO_OFFSET, WORKABLE_DAYS_OFFSET, CHRONO_DAYS_OFFSET 49 */ 50 private String offsetType; 51 52 /** 53 * display name corresponding to field (for the current company) 54 */ 55 private String displayName; 56 57 58 /** 59 * Constructor for the Field object 60 * 61 * @param fieldId unique code of field 62 * @param tableAlias table alias associated to field 63 * @param rootType root type for joins 64 * @param fieldColumn column name corresponding to field 65 * @param dataType data type of field 66 * @param menuId code of associated value menu 67 * @param offsetType offset type of field 68 * @param displayName display name of field (for current company) 69 */ 70 public Field(long fieldId, String tableAlias, String rootType, 71 String fieldColumn, String dataType, long menuId, 72 String offsetType, String displayName) { 73 this.fieldId = fieldId; 74 this.tableAlias = tableAlias; 75 this.rootType = rootType; 76 this.fieldColumn = fieldColumn; 77 this.dataType = dataType; 78 this.menuId = menuId; 79 this.offsetType = offsetType; 80 this.displayName = displayName; 81 } 82 83 // GETTER METHODS : 84 85 /** 86 * Gets the fieldId attribute of the Field object 87 * 88 * @return The fieldId value 89 */ 90 public long getFieldId() { 91 return (this.fieldId); 92 } 93 94 95 /** 96 * Gets the tableAlias attribute of the Field object 97 * 98 * @return The tableAlias value 99 */ 100 public String getTableAlias() { 101 return (this.tableAlias); 102 } 103 104 105 /** 106 * Gets the rootType attribute of the Field object 107 * 108 * @return The rootType value 109 */ 110 public String getRootType() { 111 return (this.rootType); 112 } 113 114 115 /** 116 * Gets the fieldColumn attribute of the Field object 117 * 118 * @return The fieldColumn value 119 */ 120 public String getFieldColumn() { 121 return (this.fieldColumn); 122 } 123 124 125 /** 126 * Gets the dataType attribute of the Field object 127 * 128 * @return The dataType value 129 */ 130 public String getDataType() { 131 return (this.dataType); 132 } 133 134 135 /** 136 * Gets the menuId attribute of the Field object 137 * 138 * @return The menuId value 139 */ 140 public long getMenuId() { 141 return (this.menuId); 142 } 143 144 145 /** 146 * Gets the offsetType attribute of the Field object 147 * 148 * @return The offsetType value 149 */ 150 public String getOffsetType() { 151 return (this.offsetType); 152 } 153 154 155 /** 156 * Gets the displayName attribute of the Field object 157 * 158 * @return The displayName value 159 */ 160 public String getDisplayName() { 161 return (this.displayName); 162 } 163 164 // OTHER METHODS : 165 166 /** 167 * Representation textual of the Field object 168 * 169 * @return text of the Field object 170 */ 171 public String toString() { 172 173 StringBuffer toString = new StringBuffer(); 174 toString.append("\nfieldId = "); 175 toString.append(fieldId); 176 toString.append("\ntableAlias = "); 177 toString.append(tableAlias); 178 toString.append("\nrootType = "); 179 toString.append(rootType); 180 toString.append("\nfieldColumn = "); 181 toString.append(fieldColumn); 182 toString.append("\ndataType = "); 183 toString.append(dataType); 184 toString.append("\nmenuId = "); 185 toString.append(menuId); 186 toString.append("\noffsetType = "); 187 toString.append(offsetType); 188 toString.append("\ndisplayName = "); 189 toString.append(displayName); 190 191 return new String(toString); 192 } 193 } 194