org.apache.ojb.broker.accesslayer.conversions
Interface FieldConversion

All Superinterfaces:
Serializable
All Known Implementing Classes:
BlankString2NullFieldConversion, Boolean2IntFieldConversion, Calendar2DateFieldConversion, Calendar2TimestampFieldConversion, FieldConversionDefaultImpl, GUID2StringFieldConversion, Int2IntegerFieldConversion, IntList2VarcharFieldConversion, JavaDate2SqlDateFieldConversion, JavaDate2SqlTimestampFieldConversion, Object2Base64StringFieldConversion, Object2ByteArrFieldConversion, Object2ByteArrUncompressedFieldConversion, StringList2VarcharFieldConversion, StringVector2VarcharFieldConversion, TimeList2VarcharFieldConversion

public interface FieldConversion
extends Serializable

The class FieldConversion declares a protocol for type and value conversions between persistent classes attributes and counterpart objects supported by the JDBC specification, e.g. String is supported by JDBC, so only an empty field conversion is needed. But if the persistent class attribute is of type int[] a field conversion to a supported field type is needed - e.g. int[] ---> String.

The default implementation FieldConversionDefaultImpl does not modify its input. OJB users can use predefined implementation and can also build their own conversions that perform arbitrary mappings. The mapping has to defined in the OJB mapping configuration file - more see documentation.

Version:
$Id: FieldConversion.java,v 1.1 2007-08-24 22:17:31 ewestfal Exp $
Author:
Thomas Mahler

Method Summary
 Object javaToSql(Object source)
          Convert an object of the persistent class to a counterpart object supported by the JDBC specification.
 Object sqlToJava(Object source)
          Convert a JDBC object to a persistent class value.
 

Method Detail

javaToSql

Object javaToSql(Object source)
                 throws ConversionException
Convert an object of the persistent class to a counterpart object supported by the JDBC specification.

Throws:
ConversionException

sqlToJava

Object sqlToJava(Object source)
                 throws ConversionException
Convert a JDBC object to a persistent class value.

Throws:
ConversionException


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.