1 23 24 package org.continuent.sequoia.controller.sql.schema; 25 26 import java.sql.Types ; 27 28 33 public class DatabaseProcedureParameter 34 { 35 36 37 38 public static final int ProcedureColumnUnknown = 0; 39 40 public static final int ProcedureColumnIn = 1; 41 42 public static final int ProcedureColumnInOut = 2; 43 44 public static final int ProcedureColumnOut = 3; 45 46 public static final int ProcedureColumnReturn = 4; 47 48 public static final int ProcedureColumnResult = 5; 49 50 51 52 public static final int ProcedureNoNulls = 0; 53 54 public static final int ProcedureNullable = 1; 55 56 public static final int ProcedureNullableUnknown = 2; 57 58 private String name; 59 private int columnType; 60 private int dataType; 61 private String typeName; 62 private float precision; 63 private int length; 64 private int scale; 65 private int radix; 66 private int nullable; 67 private String remarks; 68 69 76 public DatabaseProcedureParameter(String name, int columnType, int nullable) 77 { 78 this(name, columnType, Types.VARCHAR, "VARCHAR", 0, 0, 0, 0, nullable, ""); 79 } 80 81 94 public DatabaseProcedureParameter(String name, int columnType, int dataType, 95 String typeName, float precision, int length, int scale, int radix, 96 int nullable, String remarks) 97 { 98 this.name = name; 99 this.columnType = columnType; 100 this.dataType = dataType; 101 this.typeName = typeName; 102 this.precision = precision; 103 this.length = length; 104 this.scale = scale; 105 this.radix = radix; 106 this.nullable = nullable; 107 this.remarks = remarks; 108 } 109 110 113 public final int getColumnType() 114 { 115 return columnType; 116 } 117 118 121 public final void setColumnType(int columnType) 122 { 123 this.columnType = columnType; 124 } 125 126 129 public final int getDataType() 130 { 131 return dataType; 132 } 133 134 137 public final void setDataType(int dataType) 138 { 139 this.dataType = dataType; 140 } 141 142 145 public final int getLength() 146 { 147 return length; 148 } 149 150 153 public final void setLength(int length) 154 { 155 this.length = length; 156 } 157 158 161 public final String getName() 162 { 163 return name; 164 } 165 166 169 public final void setName(String name) 170 { 171 this.name = name; 172 } 173 174 177 public final int getNullable() 178 { 179 return nullable; 180 } 181 182 185 public final void setNullable(int nullable) 186 { 187 this.nullable = nullable; 188 } 189 190 193 public final float getPrecision() 194 { 195 return precision; 196 } 197 198 201 public final void setPrecision(int precision) 202 { 203 this.precision = precision; 204 } 205 206 209 public final int getRadix() 210 { 211 return radix; 212 } 213 214 217 public final void setRadix(int radix) 218 { 219 this.radix = radix; 220 } 221 222 225 public final String getRemarks() 226 { 227 return remarks; 228 } 229 230 233 public final void setRemarks(String remarks) 234 { 235 this.remarks = remarks; 236 } 237 238 241 public final int getScale() 242 { 243 return scale; 244 } 245 246 249 public final void setScale(int scale) 250 { 251 this.scale = scale; 252 } 253 254 257 public final String getTypeName() 258 { 259 return typeName; 260 } 261 262 265 public final void setTypeName(String typeName) 266 { 267 this.typeName = typeName; 268 } 269 270 277 public boolean equals(Object other) 278 { 279 if ((other == null) || !(other instanceof DatabaseProcedureParameter)) 280 return false; 281 282 DatabaseProcedureParameter p = (DatabaseProcedureParameter) other; 283 284 if (!(p.columnType == columnType && p.dataType == dataType 286 && p.precision == precision && p.length == length && p.scale == scale 287 && p.radix == radix && p.nullable == nullable)) 288 { 289 return false; 290 } 291 292 if (!(name == null ? p.name == null : name.equals(p.name))) 294 { 295 return false; 296 } 297 298 if (!(typeName == null ? p.typeName == null : typeName.equals(p.typeName))) 299 { 300 return false; 301 } 302 303 return remarks == null ? p.remarks == null : remarks.equals(p.remarks); 304 } 305 306 } | Popular Tags |