FileDocCategorySizeDatePackage
ClassType.javaAPI DocHibernate 3.2.51572Sat Sep 25 06:22:20 BST 2004org.hibernate.type

ClassType

public class ClassType extends ImmutableType
class: A type that maps an SQL VARCHAR to a Java Class.
author
Gavin King

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

		try {
			return ReflectHelper.classForName(xml);
		}
		catch (ClassNotFoundException cnfe) {
			throw new HibernateException("could not parse xml", cnfe);
		}
	
public java.lang.Objectget(java.sql.ResultSet rs, java.lang.String name)

		String str = (String) Hibernate.STRING.get(rs, name);
		if (str == null) {
			return null;
		}
		else {
			try {
				return ReflectHelper.classForName(str);
			}
			catch (ClassNotFoundException cnfe) {
				throw new HibernateException("Class not found: " + str);
			}
		}
	
public java.lang.StringgetName()

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

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

		//TODO: would be nice to handle proxy classes elegantly!
		Hibernate.STRING.set(st, ( (Class) value ).getName(), index);
	
public intsqlType()

		return Hibernate.STRING.sqlType();
	
public java.lang.StringtoString(java.lang.Object value)

		return ( (Class) value ).getName();