FileDocCategorySizeDatePackage
MetaType.javaAPI DocHibernate 3.2.53749Mon Jul 25 01:53:10 BST 2005org.hibernate.type

MetaType

public class MetaType extends AbstractType
author
Gavin King

Fields Summary
private final Map
values
private final Map
keys
private final Type
baseType
Constructors Summary
public MetaType(Map values, Type baseType)

		this.baseType = baseType;
		this.values = values;
		keys = new HashMap();
		Iterator iter = values.entrySet().iterator();
		while ( iter.hasNext() ) {
			Map.Entry me = (Map.Entry) iter.next();
			keys.put( me.getValue(), me.getKey() );
		}
	
Methods Summary
public java.lang.ObjectdeepCopy(java.lang.Object value, org.hibernate.EntityMode entityMode, org.hibernate.engine.SessionFactoryImplementor factory)

		return value;
	
public java.lang.ObjectfromXMLNode(org.dom4j.Node xml, org.hibernate.engine.Mapping factory)

		return fromXMLString( xml.getText(), factory );
	
public java.lang.ObjectfromXMLString(java.lang.String xml, org.hibernate.engine.Mapping factory)

		return xml; //xml is the entity name
	
public intgetColumnSpan(org.hibernate.engine.Mapping mapping)

		return baseType.getColumnSpan(mapping);
	
public java.lang.StringgetName()

		return baseType.getName(); //TODO!
	
public java.lang.ClassgetReturnedClass()

		return String.class;
	
public booleanisDirty(java.lang.Object old, java.lang.Object current, boolean[] checkable, org.hibernate.engine.SessionImplementor session)

		return checkable[0] && isDirty(old, current, session);
	
public booleanisMutable()

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

		Object key = baseType.nullSafeGet(rs, names, session, owner);
		return key==null ? null : values.get(key);
	
public java.lang.ObjectnullSafeGet(java.sql.ResultSet rs, java.lang.String name, org.hibernate.engine.SessionImplementor session, java.lang.Object owner)

		Object key = baseType.nullSafeGet(rs, name, session, owner);
		return key==null ? null : values.get(key);
	
public voidnullSafeSet(java.sql.PreparedStatement st, java.lang.Object value, int index, org.hibernate.engine.SessionImplementor session)

		baseType.nullSafeSet(st, value==null ? null : keys.get(value), index, session);
	
public voidnullSafeSet(java.sql.PreparedStatement st, java.lang.Object value, int index, boolean[] settable, org.hibernate.engine.SessionImplementor session)

		if ( settable[0] ) nullSafeSet(st, value, index, session);
	
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)

		return original;
	
public voidsetToXMLNode(org.dom4j.Node node, java.lang.Object value, org.hibernate.engine.SessionFactoryImplementor factory)

		node.setText( toXMLString(value, factory) );
	
public int[]sqlTypes(org.hibernate.engine.Mapping mapping)

		return baseType.sqlTypes(mapping);
	
public boolean[]toColumnNullness(java.lang.Object value, org.hibernate.engine.Mapping mapping)

		throw new UnsupportedOperationException();
	
public java.lang.StringtoLoggableString(java.lang.Object value, org.hibernate.engine.SessionFactoryImplementor factory)

		return toXMLString(value, factory);
	
public java.lang.StringtoXMLString(java.lang.Object value, org.hibernate.engine.SessionFactoryImplementor factory)

		return (String) value; //value is the entity name