001: /*
002: * HA-JDBC: High-Availability JDBC
003: * Copyright (c) 2004-2007 Paul Ferraro
004: *
005: * This library is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU Lesser General Public License as published by the
007: * Free Software Foundation; either version 2.1 of the License, or (at your
008: * option) any later version.
009: *
010: * This library is distributed in the hope that it will be useful, but WITHOUT
011: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
012: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
013: * for more details.
014: *
015: * You should have received a copy of the GNU Lesser General Public License
016: * along with this library; if not, write to the Free Software Foundation,
017: * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
018: *
019: * Contact: ferraro@users.sourceforge.net
020: */
021: package net.sf.hajdbc.cache;
022:
023: import net.sf.hajdbc.ColumnProperties;
024:
025: /**
026: * @author Paul Ferraro
027: *
028: */
029: public class ColumnPropertiesImpl implements ColumnProperties {
030: private String name;
031: private int type;
032: private String nativeType;
033: private String remarks;
034: private Boolean autoIncrement;
035: private String defaultValue;
036:
037: public ColumnPropertiesImpl(String name, int type,
038: String nativeType, String defaultValue, String remarks,
039: Boolean autoIncrement) {
040: this .name = name;
041: this .type = type;
042: this .nativeType = nativeType;
043: this .defaultValue = defaultValue;
044: this .remarks = remarks;
045: this .autoIncrement = autoIncrement;
046: }
047:
048: /**
049: * @see net.sf.hajdbc.ColumnProperties#getName()
050: */
051: @Override
052: public String getName() {
053: return this .name;
054: }
055:
056: /**
057: * @see net.sf.hajdbc.ColumnProperties#getType()
058: */
059: @Override
060: public int getType() {
061: return this .type;
062: }
063:
064: /**
065: * @see net.sf.hajdbc.ColumnProperties#getNativeType()
066: */
067: @Override
068: public String getNativeType() {
069: return this .nativeType;
070: }
071:
072: /**
073: * @see net.sf.hajdbc.ColumnProperties#getRemarks()
074: */
075: @Override
076: public String getRemarks() {
077: return this .remarks;
078: }
079:
080: /**
081: * @see net.sf.hajdbc.ColumnProperties#isAutoIncrement()
082: */
083: @Override
084: public Boolean isAutoIncrement() {
085: return this .autoIncrement;
086: }
087:
088: /**
089: * @see net.sf.hajdbc.ColumnProperties#getDefaultValue()
090: */
091: @Override
092: public String getDefaultValue() {
093: return this .defaultValue;
094: }
095:
096: /**
097: * @see java.lang.Object#equals(java.lang.Object)
098: */
099: @Override
100: public boolean equals(Object object) {
101: if ((object == null) || !(object instanceof ColumnProperties))
102: return false;
103:
104: ColumnProperties column = (ColumnProperties) object;
105:
106: return this .name.equals(column.getName());
107: }
108:
109: /**
110: * @see java.lang.Object#hashCode()
111: */
112: @Override
113: public int hashCode() {
114: return this.name.hashCode();
115: }
116:
117: }
|