FileDocCategorySizeDatePackage
BigIntegerType.javaAPI DocHibernate 3.2.51934Wed Aug 10 15:23:56 BST 2005org.hibernate.type

BigIntegerType

public class BigIntegerType extends ImmutableType implements DiscriminatorType
big_integer: A type that maps an SQL NUMERIC to a java.math.BigInteger
see
java.math.BigInteger
author
Gavin King

Fields Summary
Constructors Summary
Methods Summary
public java.lang.ObjectfromStringValue(java.lang.String xml)

		return new BigInteger(xml);
	
public java.lang.Objectget(java.sql.ResultSet rs, java.lang.String name)

		//return rs.getBigDecimal(name).toBigIntegerExact(); this 1.5 only. 
		BigDecimal bigDecimal = rs.getBigDecimal(name);
		return bigDecimal==null ? null : 
			bigDecimal.setScale(0, BigDecimal.ROUND_UNNECESSARY).unscaledValue();
	
public intgetHashCode(java.lang.Object x, org.hibernate.EntityMode entityMode)

		return ( (BigInteger) x ).intValue();
	
public java.lang.StringgetName()

		return "big_integer";
	
public java.lang.ClassgetReturnedClass()

		return BigInteger.class;
	
public booleanisEqual(java.lang.Object x, java.lang.Object y)

		return x==y || ( x!=null && y!=null && ( (BigInteger) x ).compareTo( (BigInteger) y )==0 );
	
public java.lang.StringobjectToSQLString(java.lang.Object value, org.hibernate.dialect.Dialect dialect)

		return value.toString();
	
public voidset(java.sql.PreparedStatement st, java.lang.Object value, int index)

		st.setBigDecimal( index, new BigDecimal( (BigInteger) value ) );
	
public intsqlType()

		return Types.NUMERIC;
	
public java.lang.ObjectstringToObject(java.lang.String xml)

		return new BigInteger(xml);
	
public java.lang.StringtoString(java.lang.Object value)

		return value.toString();