org.apache.cayenne.access.types
Class DefaultType

java.lang.Object
  extended by org.apache.cayenne.access.types.AbstractType
      extended by org.apache.cayenne.access.types.DefaultType
All Implemented Interfaces:
ExtendedType

public class DefaultType
extends AbstractType

An ExtendedType that can work with any Java class, providing JDBC-to-Java mapping exactly per JDBC specification.

Author:
Andrus Adamchik

Field Summary
protected  java.lang.String className
           
protected  java.lang.reflect.Method procReadMethod
           
protected  java.lang.reflect.Method readMethod
           
 
Constructor Summary
DefaultType()
          CreatesDefaultType to read objects from ResultSet using "getObject" method.
DefaultType(java.lang.String className)
           
 
Method Summary
static java.util.Iterator defaultTypes()
          Returns an Iterator of supported default Java classes (as Strings)
 java.lang.String getClassName()
          Returns a full name of Java class that this ExtendedType supports.
 java.lang.Object materializeObject(java.sql.CallableStatement st, int index, int type)
          Reads an object from a stored procedure OUT parameter, converting it to class returned by 'getClassName' method.
 java.lang.Object materializeObject(java.sql.ResultSet rs, int index, int type)
          Reads an object from JDBC ResultSet column, converting it to class returned by 'getClassName' method.
 
Methods inherited from class org.apache.cayenne.access.types.AbstractType
setJdbcObject, toString, validateNull, validateProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

className

protected java.lang.String className

readMethod

protected java.lang.reflect.Method readMethod

procReadMethod

protected java.lang.reflect.Method procReadMethod
Constructor Detail

DefaultType

public DefaultType()
CreatesDefaultType to read objects from ResultSet using "getObject" method.


DefaultType

public DefaultType(java.lang.String className)
Method Detail

defaultTypes

public static java.util.Iterator defaultTypes()
Returns an Iterator of supported default Java classes (as Strings)


getClassName

public java.lang.String getClassName()
Description copied from interface: ExtendedType
Returns a full name of Java class that this ExtendedType supports.

Specified by:
getClassName in interface ExtendedType
Specified by:
getClassName in class AbstractType

materializeObject

public java.lang.Object materializeObject(java.sql.ResultSet rs,
                                          int index,
                                          int type)
                                   throws java.lang.Exception
Description copied from interface: ExtendedType
Reads an object from JDBC ResultSet column, converting it to class returned by 'getClassName' method.

Specified by:
materializeObject in interface ExtendedType
Specified by:
materializeObject in class AbstractType
Throws:
java.lang.Exception - if read error ocurred, or an object can't be converted to a target Java class.

materializeObject

public java.lang.Object materializeObject(java.sql.CallableStatement st,
                                          int index,
                                          int type)
                                   throws java.lang.Exception
Description copied from interface: ExtendedType
Reads an object from a stored procedure OUT parameter, converting it to class returned by 'getClassName' method.

Specified by:
materializeObject in interface ExtendedType
Specified by:
materializeObject in class AbstractType
Throws:
java.lang.Exception - if read error ocurred, or an object can't be converted to a target Java class.


Copyright © 2001-2006 Apache.org All Rights Reserved.