Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.objectstyle.cayenne.access.types
Class AbstractType

    java.lang.Object
      org.objectstyle.cayenne.access.types.AbstractType

All Implemented Interfaces:
  ExtendedType

Direct Known Subclasses:
  ByteArrayType, ByteType, CharType, DefaultType, ShortType, UtilDateType

    public abstract class AbstractType

extends java.lang.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.

Author:
  Andrei Adamchik

Constructor Summary
`AbstractType()`

Method Summary
`abstract java.lang.String` | `getClassName()` Returns a full name of Java class that this ExtendedType supports.
`abstract java.lang.Object` | `materializeObject(java.sql.CallableStatement rs, int index, int type)` Reads an object from a stored procedure OUT parameter, converting it to class returned by 'getClassName' method.
`abstract 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.
`void` | `setJdbcObject(java.sql.PreparedStatement st, java.lang.Object val, int pos, int type, int precision)` Calls "PreparedStatement.setObject(..)".
`java.lang.String` | `toString()`
`static boolean` | `validateNull(java.lang.Object source, java.lang.String property, java.lang.Object value, DbAttribute dbAttribute, ValidationResult validationResult)` Helper method for ExtendedType implementors to check for null required values.
`boolean` | `validateProperty(java.lang.Object source, java.lang.String property, java.lang.Object value, DbAttribute dbAttribute, ValidationResult validationResult)` Always returns true.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### AbstractType

    public AbstractType()

Method Detail

### validateNull

    public static boolean validateNull(java.lang.Object source,
                                       java.lang.String property,
                                       java.lang.Object value,
                                       DbAttribute dbAttribute,
                                       ValidationResult validationResult)

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

  Since:
    1.2

### setJdbcObject

    public void setJdbcObject(java.sql.PreparedStatement st,
                              java.lang.Object val,
                              int pos,
                              int type,
                              int precision)
                       throws java.lang.Exception

  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:
    `java.lang.Exception`

### getClassName

    public abstract 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`

### materializeObject

    public abstract java.lang.Object materializeObject(java.sql.CallableStatement rs,
                                                       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`
  Throws:
    `java.lang.Exception` - if read error ocurred, or an object can't be converted to a target Java class.

### materializeObject

    public abstract 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`
  Throws:
    `java.lang.Exception` - if read error ocurred, or an object can't be converted to a target Java class.

### validateProperty

    public boolean validateProperty(java.lang.Object source,
                                    java.lang.String property,
                                    java.lang.Object value,
                                    DbAttribute dbAttribute,
                                    ValidationResult validationResult)

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

  Specified by:
    `validateProperty` in interface `ExtendedType`

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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