Interface JOP.persist.jdbc.TypeHandler
All Packages  Class Hierarchy  This Package  Previous  Next  Index  Home

Interface JOP.persist.jdbc.TypeHandler

public interface TypeHandler
extends Object

This is an INTERNAL class.

Interface for each type handler

A type handler is a class that is used to manager the persistence of a specific Java data type to a JDBC database. This interface must be implemented by all type handlers.

Type handlers are loaded dynamically by JOP according to the selected strategy. Type handlers must be in the package 'JOP.persist.jdbc' and they must have a name of the following format:

        TypeHandler_typename_strategy
        where
            TypeHandler is the string "TypeHandler"
            typename    is the short name of a built in Java type
                        (see JOP.perist.JavaTypes)
            strategy    is a number. Numbers must be assigned
                        sequentially starting at 1. There must
                        be no leading zeros.
    
TypeHandlers must be public classes and must have a public constructor that takes no arguments.

Method Index

 o getDefinition()
Return the name of the SQL data type for this Java type.
 o readType(ResultSet, int)
Read the column from the result set and return it as an object of the correct type (implied by this TypeHandlers name).
 o saveType(PreparedStatement, int, Object)
Save the 'object' by binding it to column of the Jdbc statement 'stmt'.

Methods

 o saveType
  public abstract void saveType(PreparedStatement stmt,
                                int column,
                                Object object) throws SQLException
Save the 'object' by binding it to column of the Jdbc statement 'stmt'. The type is one of the constants defined in JOP.persist.JavaTypes.

See Also:
JavaTypes
 o readType
  public abstract Object readType(ResultSet rs,
                                  int column) throws SQLException
Read the column from the result set and return it as an object of the correct type (implied by this TypeHandlers name).
 o getDefinition
  public abstract String getDefinition()
Return the name of the SQL data type for this Java type.

All Packages  Class Hierarchy  This Package  Previous  Next  Index  Home