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

All Superinterfaces:
java.io.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 java.io.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 365232 2005-12-21 22:36:07Z tomdz $
Author:
Thomas Mahler

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

Method Detail

javaToSql

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

Throws:
ConversionException

sqlToJava

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

Throws:
ConversionException


(C) 2002 - 2006 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30