wiki.xsx.jg.core.Field Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of JG-All Show documentation
Show all versions of JG-All Show documentation
a generator, from the database tables convert to the Java classes or from the Java classes convert to the database tables.
support mysql, oracle and sqlserver.
The newest version!
package wiki.xsx.jg.core;
/**
* 字段对象
*/
public class Field {
// 字段名称
private String name;
// 字段的数据类型
private String type;
// 字段的Java类型
private Class> javaType;
// 字段总长度
private Integer lengh;
// 字段的小数位数
private Integer scale;
// 字段的默认值
private String defaultValue;
// 是否为自增(适用于MySQL)
private boolean isAutoIncrement;
// 是否不为NULL
private boolean isNotNull;
// 是否为主键
private boolean isPrimaryKey;
// 字段的注释
private String comment;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Class> getJavaType() {
return javaType;
}
public void setJavaType(Class> javaType) {
this.javaType = javaType;
}
public Integer getLengh() {
return lengh;
}
public void setLengh(Integer lengh) {
this.lengh = lengh;
}
public Integer getScale() {
return scale;
}
public void setScale(Integer scale) {
this.scale = scale;
}
public String getDefaultValue() {
return defaultValue;
}
public void setDefaultValue(String defaultValue) {
this.defaultValue = defaultValue;
}
public Boolean getIsAutoIncrement() {
return isAutoIncrement;
}
public void setIsAutoIncrement(boolean isAutoIncrement) {
this.isAutoIncrement = isAutoIncrement;
}
public boolean getIsNotNull() {
return isNotNull;
}
public void setIsNotNull(boolean isNotNull) {
this.isNotNull = isNotNull;
}
public boolean getIsPrimaryKey() {
return isPrimaryKey;
}
public void setIsPrimaryKey(boolean isPrimaryKey) {
this.isPrimaryKey = isPrimaryKey;
}
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment;
}
@Override
public String toString() {
return "Field{" +
"name='" + name + '\'' +
", type='" + type + '\'' +
", javaType=" + javaType +
", lengh=" + lengh +
", scale=" + scale +
", defaultValue='" + defaultValue + '\'' +
", isAutoIncrement=" + isAutoIncrement +
", isNotNull=" + isNotNull +
", isPrimaryKey=" + isPrimaryKey +
", comment='" + comment + '\'' +
'}';
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy