FileDocCategorySizeDatePackage
CharacterArrayType.javaAPI DocHibernate 3.2.51063Fri Jun 09 22:24:06 BST 2006org.hibernate.type

CharacterArrayType

public class CharacterArrayType extends AbstractCharArrayType
Bridge Character[] and VARCHAR
author
Emmanuel Bernard

Fields Summary
Constructors Summary
Methods Summary
public java.lang.StringgetName()

 return "wrapper-characters"; 
public java.lang.ClassgetReturnedClass()

		return Character[].class;
	
protected java.lang.ObjecttoExternalFormat(char[] chars)

		if (chars == null) return null;
		Character[] characters = new Character[chars.length];
		for (int i = 0 ; i < chars.length ; i++) {
			characters[i] = new Character( chars[i] );
		}
		return characters;
	
protected char[]toInternalFormat(java.lang.Object value)

		if (value == null) return null;
		Character[] characters = (Character[]) value;
		char[] chars = new char[characters.length];
		for (int i = 0 ; i < characters.length ; i++) {
			if (characters[i] == null)
				throw new HibernateException("Unable to store an Character[] when one of its element is null");
			chars[i] = characters[i].charValue();
		}
		return chars;