FileDocCategorySizeDatePackage
DoubleStringType.javaAPI DocHibernate 3.2.52863Sun Sep 26 00:18:28 BST 2004org.hibernate.test.legacy

DoubleStringType

public class DoubleStringType extends Object implements org.hibernate.usertype.CompositeUserType

Fields Summary
private static final int[]
TYPES
Constructors Summary
Methods Summary
public java.lang.Objectassemble(java.io.Serializable cached, org.hibernate.engine.SessionImplementor session, java.lang.Object owner)


		return deepCopy(cached);
	
public java.lang.ObjectdeepCopy(java.lang.Object x)

		if (x==null) return null;
		String[] result = new String[2];
		String[] input = (String[]) x;
		result[0] = input[0];
		result[1] = input[1];
		return result;
	
public java.io.Serializabledisassemble(java.lang.Object value, org.hibernate.engine.SessionImplementor session)

		return (Serializable) deepCopy(value);
	
public booleanequals(java.lang.Object x, java.lang.Object y)

		if (x==y) return true;
		if (x==null || y==null) return false;
		return ( (String[]) x )[0].equals( ( (String[]) y )[0] ) && ( (String[]) x )[1].equals( ( (String[]) y )[1] );
	
public java.lang.String[]getPropertyNames()

		return new String[] { "s1", "s2" };
	
public org.hibernate.type.Type[]getPropertyTypes()

		return new Type[] { Hibernate.STRING, Hibernate.STRING };
	
public java.lang.ObjectgetPropertyValue(java.lang.Object component, int property)

		return ( (String[]) component )[property];
	
public inthashCode(java.lang.Object x)

		String[] a = (String[]) x;
		return a[0].hashCode() + 31 * a[1].hashCode(); 
	
public booleanisMutable()

 return true; 
public java.lang.ObjectnullSafeGet(java.sql.ResultSet rs, java.lang.String[] names, org.hibernate.engine.SessionImplementor session, java.lang.Object owner)


		String first = (String) Hibernate.STRING.nullSafeGet(rs, names[0]);
		String second = (String) Hibernate.STRING.nullSafeGet(rs, names[1]);

		return ( first==null && second==null ) ? null : new String[] { first, second };
	
public voidnullSafeSet(java.sql.PreparedStatement st, java.lang.Object value, int index, org.hibernate.engine.SessionImplementor session)


		String[] strings = (value==null) ? new String[2] : (String[]) value;

		Hibernate.STRING.nullSafeSet(st, strings[0], index);
		Hibernate.STRING.nullSafeSet(st, strings[1], index+1);
	
public java.lang.Objectreplace(java.lang.Object original, java.lang.Object target, org.hibernate.engine.SessionImplementor session, java.lang.Object owner)

		return original;
	
public java.lang.ClassreturnedClass()

		return String[].class;
	
public voidsetPropertyValue(java.lang.Object component, int property, java.lang.Object value)


		( (String[]) component )[property] = (String) value;
	
public int[]sqlTypes()


	   
		return TYPES;