Package org.apache.ojb.broker.accesslayer.conversions

This package contains classes related to type and value conversions between attributes of persistent classes and their mapped columns in the relational database.

See:
          Description

Interface Summary
FieldConversion 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.
 

Class Summary
BlankString2NullFieldConversion this implementation of the FieldConversion interface converts between blank strings ("") and nulls values in the rdbms.
Boolean2IntFieldConversion this implementation of the FieldConversion interface converts between java Boolean values and int values in the rdbms.
Calendar2DateFieldConversion This implementation of the FieldConversion interface converts between Calendar and Date.
Calendar2TimestampFieldConversion This implementation of the FieldConversion interface converts between Calendar and Timestamp.
FieldConversionDefaultImpl default implementation of the FieldConversion interface.
GUID2StringFieldConversion this implementation of the FieldConversion interface converts between GUIDs and their String representation.
Int2IntegerFieldConversion this implementation of the FieldConversion interface converts int to Integer, Integer to int.
IntList2VarcharFieldConversion This implementation of the FieldConversion interface converts between a List of Integer objects and a database varchar field.
JavaDate2SqlDateFieldConversion this implementation of the FieldConversion interface converts between java.util.Date values and java.sql.Date values in the rdbms.
JavaDate2SqlTimestampFieldConversion this implementation of the FieldConversion interface converts between java.util.Date values and java.sql.Timestamp values in the rdbms.
Object2Base64StringFieldConversion this implementation of the FieldConversion interface converts between java.lang.Objects values and char[] values in the rdbms.
Object2ByteArrFieldConversion This implementation of the FieldConversion interface converts between java.lang.Objects values and byte[] values in the rdbms.
Object2ByteArrUncompressedFieldConversion This implementation of the FieldConversion interface converts between java.lang.Objects values and byte[] values in the rdbms.
StringList2VarcharFieldConversion This implementation of the FieldConversion interface converts between a List of String objects and a database varchar field.
StringVector2VarcharFieldConversion Converts a Vector of string elements back and forth from a database varchar field Strings may not contain "#" as this is used as separator.
TimeList2VarcharFieldConversion This implementation of the FieldConversion interface converts between a List of Time objects and a database varchar field.
 

Exception Summary
ConversionException A ConversionException can be thrown by implementors of FieldConversion to signal failures during the conversion process.
 

Package org.apache.ojb.broker.accesslayer.conversions Description

This package contains classes related to type and value conversions between attributes of persistent classes and their mapped columns in the relational database.

The FieldConversion>/code> interface defines two callback methods for conversion from Java to Database (javaToSql(Object source)) and from Database to Java (sqlToJava(Object source)).
OJB users can use predefined FieldConversion implementations contained in this package and can also implement their own conversions that perform arbitrary mappings. The usage of a FieldConversion must be declared in the FieldDescriptor element in the repository.xml file.

The conversion-methods of the FieldConversion>/code> interface may throw a ConversionException to signal errors during the conversion operations.

The class FieldConversionDefaultImpl is the default implementation of the FieldConversion>/code> interface. This implementation does not modify its input.

The class Boolean2IntFieldConversion is an implementation of the FieldConversion>/code> interface that provides a conversion from persistent classes attributes of type Boolean to rdbms columns of type BIGINT, INTEGER, SMALLINT, TINYINT or BIT.

The class JavaDate2SqlDateFieldConversion is an implementation of the FieldConversion>/code> interface that provides a conversion from persistent classes attributes of type java.util.Date to rdbms columns of type java.sql.Date.

The class Object2ByteArrFieldConversion is an implementation of the FieldConversion>/code> interface that provides a conversion from persistent classes attributes of type java.lang.Object (or any subtype) to rdbms columns of a type able of holding byte arrays (CHAR, VARCHAR, LONGVARCHAR, BINARY, VARBINARY, or LONGVARBINARY).
This conversion can be useful if embedded objects can not be mapped on a dedicated extra table but must be "inlined". This approach is used for the mapping of DListEntry object that hold an inlined Identity Object.

Patterns applied: Callback, Strategy

Todo: Provide more predefined implementations



(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