StringUserTypeBase (fawkeZ - Developer's Documentation)

org.jcoderz.commons.util
Class StringUserTypeBase

  extended by org.jcoderz.commons.util.UserTypeBase
      extended by org.jcoderz.commons.util.StringUserTypeBase
All Implemented Interfaces:
,

public abstract class StringUserTypeBase
extends UserTypeBase

This class is used by the Hibernate binding for RestrictedStrings. A subclass has to implement the fromString method for the particular RestrictedString. Be aware that VARCHAR is restricted to 1000 Unicode characters!

Author:
thomas.bodemer
See Also:
Serialized Form

Constructor Summary
StringUserTypeBase()
           
 
Method Summary
abstract   fromString( value)
          Implement this method for the particular RestrictedString.
abstract   getEmptyOrNull()
          Implement this method for the particular RestrictedString.
  nullSafeGet( resultSet, [] types,  owner)
          
 void nullSafeSet( statement,  value, int index)
          
 int[] sqlTypes()
          
 
Methods inherited from class org.jcoderz.commons.util.UserTypeBase
assemble, deepCopy, disassemble, equals, hashCode, isMutable, replace, returnedClass
 
Methods inherited from class java.lang.
, , , , , , , , , ,
 

Constructor Detail

StringUserTypeBase

public StringUserTypeBase()
Method Detail

nullSafeGet

public  nullSafeGet( resultSet,
                          [] types,
                           owner)
                   throws ,
                          

Specified by:
in interface
Specified by:
nullSafeGet in class UserTypeBase
Throws:

getEmptyOrNull

public abstract  getEmptyOrNull()
Implement this method for the particular RestrictedString.

Returns:
either null or fromString("") if the StrongType permits this.

fromString

public abstract  fromString( value)
Implement this method for the particular RestrictedString.

Parameters:
value - the String representation of the mapped class
Returns:
the instance of the mapped class

nullSafeSet

public void nullSafeSet( statement,
                         value,
                        int index)
                 throws ,
                        

Specified by:
in interface
Specified by:
nullSafeSet in class UserTypeBase
Throws:

sqlTypes

public int[] sqlTypes()

Specified by:
in interface
Specified by:
sqlTypes in class UserTypeBase


Copyright 2007 The jCoderZ Project.