001: /*
002: * Copyright 2006-2007 Pentaho Corporation. All rights reserved.
003: * This software was developed by Pentaho Corporation and is provided under the terms
004: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
005: * this file except in compliance with the license. If you need a copy of the license,
006: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt.
007: *
008: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
009: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
010: * the license for the specific language governing your rights and limitations.
011: *
012: * Additional Contributor(s): Martin Schmid gridvision engineering GmbH
013: */
014: package org.pentaho.reportdesigner.crm.report.datasetplugin.composer;
015:
016: import org.jetbrains.annotations.NotNull;
017: import org.jetbrains.annotations.Nullable;
018:
019: /**
020: * User: Martin
021: * Date: 06.03.2006
022: * Time: 08:23:06
023: */
024: public class JDBCColumnInfo {
025: @Nullable
026: private String catalog;
027: @Nullable
028: private String schema;
029: @NotNull
030: private String tableName;
031: @NotNull
032: private String columnName;
033: @Nullable
034: private String dataType;
035: @Nullable
036: private String typeName;
037: private int columnSize;
038: //private void bufferLength;
039: private int decimalDigits;
040: private int numRecRadix;
041: private int nullable;
042: @Nullable
043: private String remarks;
044: @Nullable
045: private String defaultValue;
046: //private int sqlDataType;
047: //private int sqlDateTimeSub;
048: private int charOctetLength;
049: private int ordinalPosition;
050: @Nullable
051: private String isNullable;
052: @Nullable
053: private String scopeCatalog;
054: @Nullable
055: private String scopeSchema;
056: @Nullable
057: private String sourceDataType;
058:
059: public JDBCColumnInfo() {
060: columnName = "";
061: tableName = "";
062: }
063:
064: public JDBCColumnInfo(@NotNull
065: String catalog, @NotNull
066: String schema, @NotNull
067: String tableName, @NotNull
068: String columnName, @NotNull
069: String dataType, @NotNull
070: String typeName, int columnSize, int decimalDigits,
071: int numRecRadix, int nullable, @NotNull
072: String remarks, @NotNull
073: String defaultValue, int charOctetLength,
074: int ordinalPosition, @NotNull
075: String isNullable, @NotNull
076: String scopeCatalog, @NotNull
077: String scopeSchema, @NotNull
078: String sourceDataType) {
079: this .catalog = catalog;
080: this .schema = schema;
081: this .tableName = tableName;
082: this .columnName = columnName;
083: this .dataType = dataType;
084: this .typeName = typeName;
085: this .columnSize = columnSize;
086: this .decimalDigits = decimalDigits;
087: this .numRecRadix = numRecRadix;
088: this .nullable = nullable;
089: this .remarks = remarks;
090: this .defaultValue = defaultValue;
091: this .charOctetLength = charOctetLength;
092: this .ordinalPosition = ordinalPosition;
093: this .isNullable = isNullable;
094: this .scopeCatalog = scopeCatalog;
095: this .scopeSchema = scopeSchema;
096: this .sourceDataType = sourceDataType;
097: }
098:
099: public void setCatalog(@NotNull
100: String catalog) {
101: this .catalog = catalog;
102: }
103:
104: public void setSchema(@NotNull
105: String schema) {
106: this .schema = schema;
107: }
108:
109: public void setTableName(@NotNull
110: String tableName) {
111: this .tableName = tableName;
112: }
113:
114: public void setColumnName(@NotNull
115: String columnName) {
116: this .columnName = columnName;
117: }
118:
119: public void setDataType(@NotNull
120: String dataType) {
121: this .dataType = dataType;
122: }
123:
124: public void setTypeName(@NotNull
125: String typeName) {
126: this .typeName = typeName;
127: }
128:
129: public void setColumnSize(int columnSize) {
130: this .columnSize = columnSize;
131: }
132:
133: public void setDecimalDigits(int decimalDigits) {
134: this .decimalDigits = decimalDigits;
135: }
136:
137: public void setNumRecRadix(int numRecRadix) {
138: this .numRecRadix = numRecRadix;
139: }
140:
141: @SuppressWarnings({"NullableProblems"})
142: public void setNullable(int nullable) {
143: this .nullable = nullable;
144: }
145:
146: public void setRemarks(@NotNull
147: String remarks) {
148: this .remarks = remarks;
149: }
150:
151: public void setDefaultValue(@NotNull
152: String defaultValue) {
153: this .defaultValue = defaultValue;
154: }
155:
156: public void setCharOctetLength(int charOctetLength) {
157: this .charOctetLength = charOctetLength;
158: }
159:
160: public void setOrdinalPosition(int ordinalPosition) {
161: this .ordinalPosition = ordinalPosition;
162: }
163:
164: public void setNullable(@NotNull
165: String nullable) {
166: isNullable = nullable;
167: }
168:
169: public void setScopeCatalog(@NotNull
170: String scopeCatalog) {
171: this .scopeCatalog = scopeCatalog;
172: }
173:
174: public void setScopeSchema(@NotNull
175: String scopeSchema) {
176: this .scopeSchema = scopeSchema;
177: }
178:
179: public void setSourceDataType(@NotNull
180: String sourceDataType) {
181: this .sourceDataType = sourceDataType;
182: }
183:
184: @Nullable
185: public String getCatalog() {
186: return catalog;
187: }
188:
189: @Nullable
190: public String getSchema() {
191: return schema;
192: }
193:
194: @NotNull
195: public String getTableName() {
196: return tableName;
197: }
198:
199: @Nullable
200: public String getColumnName() {
201: return columnName;
202: }
203:
204: @Nullable
205: public String getDataType() {
206: return dataType;
207: }
208:
209: @Nullable
210: public String getTypeName() {
211: return typeName;
212: }
213:
214: public int getColumnSize() {
215: return columnSize;
216: }
217:
218: public int getDecimalDigits() {
219: return decimalDigits;
220: }
221:
222: public int getNumRecRadix() {
223: return numRecRadix;
224: }
225:
226: @SuppressWarnings({"NullableProblems"})
227: public int getNullable() {
228: return nullable;
229: }
230:
231: @Nullable
232: public String getRemarks() {
233: return remarks;
234: }
235:
236: @Nullable
237: public String getDefaultValue() {
238: return defaultValue;
239: }
240:
241: public int getCharOctetLength() {
242: return charOctetLength;
243: }
244:
245: public int getOrdinalPosition() {
246: return ordinalPosition;
247: }
248:
249: @Nullable
250: public String getIsNullable() {
251: return isNullable;
252: }
253:
254: @Nullable
255: public String getScopeCatalog() {
256: return scopeCatalog;
257: }
258:
259: @Nullable
260: public String getScopeSchema() {
261: return scopeSchema;
262: }
263:
264: @Nullable
265: public String getSourceDataType() {
266: return sourceDataType;
267: }
268:
269: public boolean equals(@Nullable
270: Object o) {
271: if (this == o)
272: return true;
273: if (o == null || getClass() != o.getClass())
274: return false;
275:
276: final JDBCColumnInfo that = (JDBCColumnInfo) o;
277:
278: if (charOctetLength != that.charOctetLength)
279: return false;
280: if (columnSize != that.columnSize)
281: return false;
282: if (decimalDigits != that.decimalDigits)
283: return false;
284: if (nullable != that.nullable)
285: return false;
286: if (numRecRadix != that.numRecRadix)
287: return false;
288: if (ordinalPosition != that.ordinalPosition)
289: return false;
290: if (catalog != null ? !catalog.equals(that.catalog)
291: : that.catalog != null)
292: return false;
293: if (!columnName.equals(that.columnName))
294: return false;
295: if (dataType != null ? !dataType.equals(that.dataType)
296: : that.dataType != null)
297: return false;
298: if (defaultValue != null ? !defaultValue
299: .equals(that.defaultValue) : that.defaultValue != null)
300: return false;
301: if (isNullable != null ? !isNullable.equals(that.isNullable)
302: : that.isNullable != null)
303: return false;
304: if (remarks != null ? !remarks.equals(that.remarks)
305: : that.remarks != null)
306: return false;
307: if (schema != null ? !schema.equals(that.schema)
308: : that.schema != null)
309: return false;
310: if (scopeCatalog != null ? !scopeCatalog
311: .equals(that.scopeCatalog) : that.scopeCatalog != null)
312: return false;
313: if (scopeSchema != null ? !scopeSchema.equals(that.scopeSchema)
314: : that.scopeSchema != null)
315: return false;
316: if (sourceDataType != null ? !sourceDataType
317: .equals(that.sourceDataType)
318: : that.sourceDataType != null)
319: return false;
320: if (!tableName.equals(that.tableName))
321: return false;
322: return !(typeName != null ? !typeName.equals(that.typeName)
323: : that.typeName != null);
324:
325: }
326:
327: public int hashCode() {
328: int result;
329: result = (catalog != null ? catalog.hashCode() : 0);
330: result = 29 * result + (schema != null ? schema.hashCode() : 0);
331: result = 29 * result + (tableName.hashCode());
332: result = 29 * result + (columnName.hashCode());
333: result = 29 * result
334: + (dataType != null ? dataType.hashCode() : 0);
335: result = 29 * result
336: + (typeName != null ? typeName.hashCode() : 0);
337: result = 29 * result + columnSize;
338: result = 29 * result + decimalDigits;
339: result = 29 * result + numRecRadix;
340: result = 29 * result + nullable;
341: result = 29 * result
342: + (remarks != null ? remarks.hashCode() : 0);
343: result = 29 * result
344: + (defaultValue != null ? defaultValue.hashCode() : 0);
345: result = 29 * result + charOctetLength;
346: result = 29 * result + ordinalPosition;
347: result = 29 * result
348: + (isNullable != null ? isNullable.hashCode() : 0);
349: result = 29 * result
350: + (scopeCatalog != null ? scopeCatalog.hashCode() : 0);
351: result = 29 * result
352: + (scopeSchema != null ? scopeSchema.hashCode() : 0);
353: result = 29
354: * result
355: + (sourceDataType != null ? sourceDataType.hashCode()
356: : 0);
357: return result;
358: }
359:
360: @NotNull
361: public String toString() {
362: return "JDBCColumnInfo{" + "catalog='" + catalog + "'"
363: + ", schema='" + schema + "'" + ", tableName='"
364: + tableName + "'" + ", columnName='" + columnName + "'"
365: + ", dataType='" + dataType + "'" + ", typeName='"
366: + typeName + "'" + ", columnSize=" + columnSize
367: + ", decimalDigits=" + decimalDigits + ", numRecRadix="
368: + numRecRadix + ", nullable=" + nullable
369: + ", remarks='" + remarks + "'" + ", defaultValue='"
370: + defaultValue + "'" + ", charOctetLength="
371: + charOctetLength + ", ordinalPosition="
372: + ordinalPosition + ", isNullable='" + isNullable + "'"
373: + ", scopeCatalog='" + scopeCatalog + "'"
374: + ", scopeSchema='" + scopeSchema + "'"
375: + ", sourceDataType='" + sourceDataType + "'" + "}";
376: }
377: }
|