com.objectsql.support.TableColumn Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of object-sql Show documentation
Show all versions of object-sql Show documentation
Lightweight Object SQL Relational Mapping (OSRM)
The newest version!
/*
* Copyright 2017 @objectsql.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.objectsql.support;
public class TableColumn {
private String table;
private String column;
private String type;
private Integer order;
private boolean nullable = true;
private Long length = 0L;
private Integer precision = 0;
private Integer scale = 0;
private String comment;
private boolean isPrimaryKey = false;
private ColumnType columnType;
private boolean autoIncrement = false;
private boolean dropped = false;
private String sequence;
public String getSequence() {
return sequence;
}
public void setSequence(String sequence) {
this.sequence = sequence;
}
public boolean isPrimaryKey() {
return isPrimaryKey;
}
public void setIsPrimaryKey(boolean isPrimaryKey) {
this.isPrimaryKey = isPrimaryKey;
}
private String columnClass;
public String getColumnClass() {
return columnClass;
}
public void setColumnClass(String columnClass) {
this.columnClass = columnClass;
}
public boolean isDropped() {
return dropped;
}
public void setDropped(boolean dropped) {
this.dropped = dropped;
}
// private Integer sensitive = -1;//mysql
public String getDefaultValue() {
return defaultValue;
}
public void setDefaultValue(String defaultValue) {
this.defaultValue = defaultValue;
}
private String defaultValue;
public TableColumn(){}
public TableColumn(String table, String column){
this.table = table;
this.column = column;
}
public String getTable() {
return table;
}
public void setTable(String table) {
this.table = table;
}
public String getColumn() {
return column;
}
public void setColumn(String column) {
this.column = column;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Integer getOrder() {
return order;
}
public void setOrder(Integer order) {
this.order = order;
}
public boolean isNullable() {
return nullable;
}
public void setNullable(boolean nullable) {
this.nullable = nullable;
}
public Long getLength() {
return length;
}
public void setLength(Long length) {
this.length = length;
}
public Integer getPrecision() {
return precision;
}
public void setPrecision(Integer precision) {
this.precision = precision;
}
public Integer getScale() {
return scale;
}
public void setScale(Integer scale) {
this.scale = scale;
}
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment;
}
public ColumnType getColumnType() {
return columnType;
}
public void setColumnType(ColumnType columnType) {
this.columnType = columnType;
}
public boolean isAutoIncrement() {
return autoIncrement;
}
public void setAutoIncrement(boolean autoIncrement) {
this.autoIncrement = autoIncrement;
}
@Override
public String toString() {
return "TableColumn{" +
"table='" + table + '\'' +
"column='" + column + '\'' +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
TableColumn column1 = (TableColumn) o;
if (!table.equals(column1.table)) return false;
return column.equals(column1.column);
}
@Override
public int hashCode() {
int result = table.hashCode();
result = 31 * result + column.hashCode();
return result;
}
}