package org.arsenal.framework.engine.table;

import org.arsenal.framework.engine.IMapping;
import org.arsenal.framework.engine.mapping.MappingBoolean;
import org.arsenal.framework.engine.mapping.MappingByte;
import org.arsenal.framework.engine.mapping.MappingInteger;
import org.arsenal.framework.engine.mapping.MappingLong;
import org.arsenal.framework.engine.mapping.MappingShort;
import org.arsenal.framework.engine.mapping.MappingString;
import org.arsenal.framework.util.Assert;

//唯一标识是 name
public class TableColumnShort extends  TableColumn {

 

	protected MappingShort defaultV;// 默认值,toString

 
	public TableColumnShort() {
		 
 	}
	
 	public TableColumnShort(String name, String desc,  
			boolean isNull,  boolean unique ,Short defaultV) {
 		super(name, desc, IMapping.int_type, isNull,  unique ,defaultV);
	 	if (defaultV != null) {
	 		super.defaultV = this.defaultV = new MappingShort(defaultV );
		}
 	}
 	
 	public TableColumnShort(MappingString name, MappingString desc, MappingByte type, 
			MappingBoolean isNull, MappingBoolean unique  ) {
		super(name,desc,type,isNull,unique);
	}
 

	public  Short getDefaultV() {
		return defaultV.getValue();
	}

	public void setDefaultV(Short defaultV) {
		Assert.notNull(defaultV);
		super.defaultV = this.defaultV = new MappingShort(defaultV);
	}
	public void setDefaultV(MappingShort defaultV) {
		Assert.notNull(defaultV);
		super.defaultV = this.defaultV = defaultV;
	}

}
