FileDocCategorySizeDatePackage
AbstractType.javaAPI DocHibernate 3.2.54394Wed Aug 10 00:06:40 BST 2005org.hibernate.type

AbstractType

public abstract class AbstractType extends Object implements Type
Abstract superclass of the built in Type hierarchy.
author
Gavin King

Fields Summary
Constructors Summary
Methods Summary
public java.lang.Objectassemble(java.io.Serializable cached, org.hibernate.engine.SessionImplementor session, java.lang.Object owner)

		if ( cached==null ) {
			return null;
		}
		else {
			return deepCopy( cached, session.getEntityMode(), session.getFactory() );
		}
	
public voidbeforeAssemble(java.io.Serializable cached, org.hibernate.engine.SessionImplementor session)

public intcompare(java.lang.Object x, java.lang.Object y, org.hibernate.EntityMode entityMode)

		return ( (Comparable) x ).compareTo(y);
	
public java.io.Serializabledisassemble(java.lang.Object value, org.hibernate.engine.SessionImplementor session, java.lang.Object owner)


		if (value==null) {
			return null;
		}
		else {
			return (Serializable) deepCopy( value, session.getEntityMode(), session.getFactory() );
		}
	
public intgetHashCode(java.lang.Object x, org.hibernate.EntityMode entityMode)

		return x.hashCode();
	
public intgetHashCode(java.lang.Object x, org.hibernate.EntityMode entityMode, org.hibernate.engine.SessionFactoryImplementor factory)

		return getHashCode(x, entityMode);
	
public TypegetSemiResolvedType(org.hibernate.engine.SessionFactoryImplementor factory)

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

		// TODO: this is very suboptimal for some subclasses (namely components),
		// since it does not take advantage of two-phase-load
		return nullSafeGet(rs, names, session, owner);
	
public booleanisAnyType()

		return false;
	
public booleanisAssociationType()

		return false;
	
public booleanisCollectionType()

		return false;
	
public booleanisComponentType()

		return false;
	
public booleanisDirty(java.lang.Object old, java.lang.Object current, org.hibernate.engine.SessionImplementor session)

		return !isSame( old, current, session.getEntityMode() );
	
public booleanisEntityType()

		return false;
	
public booleanisEqual(java.lang.Object x, java.lang.Object y, org.hibernate.EntityMode entityMode)

		return EqualsHelper.equals(x, y);
	
public booleanisEqual(java.lang.Object x, java.lang.Object y, org.hibernate.EntityMode entityMode, org.hibernate.engine.SessionFactoryImplementor factory)

		return isEqual(x, y, entityMode);
	
public booleanisModified(java.lang.Object old, java.lang.Object current, boolean[] checkable, org.hibernate.engine.SessionImplementor session)

		return isDirty(old, current, session);
	
public booleanisSame(java.lang.Object x, java.lang.Object y, org.hibernate.EntityMode entityMode)

		return isEqual(x, y, entityMode);
	
public booleanisXMLElement()

		return false;
	
public java.lang.Objectreplace(java.lang.Object original, java.lang.Object target, org.hibernate.engine.SessionImplementor session, java.lang.Object owner, java.util.Map copyCache, ForeignKeyDirection foreignKeyDirection)

		boolean include;
		if ( isAssociationType() ) {
			AssociationType atype = (AssociationType) this;
			include = atype.getForeignKeyDirection()==foreignKeyDirection;
		}
		else {
			include = ForeignKeyDirection.FOREIGN_KEY_FROM_PARENT==foreignKeyDirection;
		}
		return include ? replace(original, target, session, owner, copyCache) : target;
	
protected static voidreplaceNode(org.dom4j.Node container, org.dom4j.Element value)

		if ( container!=value ) { //not really necessary, I guess...
			Element parent = container.getParent();
			container.detach();
			value.setName( container.getName() );
			value.detach();
			parent.add(value);
		}
	
public java.lang.Objectresolve(java.lang.Object value, org.hibernate.engine.SessionImplementor session, java.lang.Object owner)

		return value;
	
public java.lang.ObjectsemiResolve(java.lang.Object value, org.hibernate.engine.SessionImplementor session, java.lang.Object owner)

		return value;