org.apache.cayenne.access.types
Class AbstractType

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

Deprecated. since 3.0, as not common superclass for ExtendedTypes is deemed necessary.

public abstract class AbstractType
extends Object
implements ExtendedType

A convenience superclass of ExtendedType implementations. Implements setJdbcObject(PreparedStatement, Object, int, int, int)in a generic fashion by calling "setObject(..)" on PreparedStatement. Some adapters may need to override this behavior as it doesn't work consistently across all JDBC drivers.


Constructor Summary
AbstractType()
          Deprecated.  
 
Method Summary
abstract  String getClassName()
          Deprecated. Returns a full name of Java class that this ExtendedType supports.
abstract  Object materializeObject(CallableStatement rs, int index, int type)
          Deprecated. Reads an object from a stored procedure OUT parameter, converting it to class returned by 'getClassName' method.
abstract  Object materializeObject(ResultSet rs, int index, int type)
          Deprecated. Reads an object from JDBC ResultSet column, converting it to class returned by 'getClassName' method.
 void setJdbcObject(PreparedStatement st, Object val, int pos, int type, int scale)
          Deprecated. Calls "PreparedStatement.setObject(..)".
 String toString()
          Deprecated.  
static boolean validateNull(Object source, String property, Object value, DbAttribute dbAttribute, ValidationResult validationResult)
          Deprecated. since 3.0 as validation should not be done at the DataNode level.
 boolean validateProperty(Object source, String property, Object value, DbAttribute dbAttribute, ValidationResult validationResult)
          Deprecated. since 3.0 as validation should not be done at the DataNode level.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractType

public AbstractType()
Deprecated. 
Method Detail

validateNull

public static boolean validateNull(Object source,
                                   String property,
                                   Object value,
                                   DbAttribute dbAttribute,
                                   ValidationResult validationResult)
Deprecated. since 3.0 as validation should not be done at the DataNode level.

Helper method for ExtendedType implementors to check for null required values.

Since:
1.2

setJdbcObject

public void setJdbcObject(PreparedStatement st,
                          Object val,
                          int pos,
                          int type,
                          int scale)
                   throws Exception
Deprecated. 
Calls "PreparedStatement.setObject(..)". Some DbAdapters may need to override this behavior for at least some of the object types, as it doesn't work consistently across all JDBC drivers.

Specified by:
setJdbcObject in interface ExtendedType
Throws:
Exception

getClassName

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

Specified by:
getClassName in interface ExtendedType

materializeObject

public abstract Object materializeObject(CallableStatement rs,
                                         int index,
                                         int type)
                                  throws Exception
Deprecated. 
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
Throws:
Exception - if read error ocurred, or an object can't be converted to a target Java class.

materializeObject

public abstract Object materializeObject(ResultSet rs,
                                         int index,
                                         int type)
                                  throws Exception
Deprecated. 
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
Throws:
Exception - if read error ocurred, or an object can't be converted to a target Java class.

validateProperty

public boolean validateProperty(Object source,
                                String property,
                                Object value,
                                DbAttribute dbAttribute,
                                ValidationResult validationResult)
Deprecated. since 3.0 as validation should not be done at the DataNode level.

Always returns true. Simplifies subclass implementation, as only some of the types can perform the validation.

Specified by:
validateProperty in interface ExtendedType

toString

public String toString()
Deprecated. 
Overrides:
toString in class Object


Copyright © 2001-2011 Apache Cayenne. All Rights Reserved.