package cn.orm.util.metadata.base;
/**
 * 管理数据库表中字段的相关信息，如：字段名、字段类型、默认值等等
 * 来自IntrospectedColumn的部分字段
 */
public class Field 
{
	private String name;//字段名
	private int size;//字段长度,在DatabaseMetaData中均用String表示//获取COLUMN_SIZE
	private String defaultValue; //默认值
	private boolean nullable = false;//是否允许为空值，true允许，false不允许
	private int JdbcType; //SQL类别 数字
	private String jdbcTypeName;//SQL字段类型
	private boolean primarykey;//主键
	private boolean foreignkey = false;//是否是外键键 目前还没有处理
	private String comment = "";//说明,注释
	//Java字段类型 column.getFullyQualifiedJavaType().getFullyQualifiedName()
	private String javaTypeName;

	public Field() {}

	public boolean isForeignkey() {
		return foreignkey;
	}
	public void setForeignkey(boolean foreignkey) {
		this.foreignkey = foreignkey;
	}
	public int getSize() {
		return size;
	}
	public void setSize(int size) {
		this.size = size;
	}
	public String getComment() {
		return comment;
	}
	public void setComment(String comment) {
		this.comment = comment;
	}
	public String getDefaultValue() {
		return defaultValue;
	}
	public void setDefaultValue(String defaultValue) {
		this.defaultValue = defaultValue;
	}
	public int getJdbcType() {
		return JdbcType;
	}
	public void setJdbcType(int jdbcType) {
		JdbcType = jdbcType;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getJdbcTypeName() {
		return jdbcTypeName;
	}
	public void setJdbcTypeName(String jdbcTypeName) {
		this.jdbcTypeName = jdbcTypeName;
	}
	public boolean isPrimarykey() {
		return primarykey;
	}
	public void setPrimarykey(boolean primarykey) {
		this.primarykey = primarykey;
	}
	public boolean isNullable() {
		return nullable;
	}
	public void setNullable(boolean nullable) {
		this.nullable = nullable;
	}
	//f.getTypeClassName
	public String getJavaTypeName() {
		return javaTypeName;
	}
	public void setJavaTypeName(String javaTypeName) {
		this.javaTypeName = javaTypeName;
	}

}
