Author: arminw
Date: Mon May 1 16:50:31 2006
New Revision: 398741
URL: http://svn.apache.org/viewcvs?rev=398741&view=rev
Log:
add noop implementation class
Modified:
db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/conversions/FieldConversion.java
Modified:
db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/conversions/FieldConversion.java
URL:
http://svn.apache.org/viewcvs/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/conversions/FieldConversion.java?rev=398741&r1=398740&r2=398741&view=diff
==============================================================================
---
db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/conversions/FieldConversion.java
(original)
+++
db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/accesslayer/conversions/FieldConversion.java
Mon May 1 16:50:31 2006
@@ -25,7 +25,7 @@
* conversion is needed. But if the persistent class attribute is of type
<code>int[]</code> a
* field conversion to a supported field type is needed - e.g. <code>int[]
---> String</code>.
* <p/>
- * The default implementation [EMAIL PROTECTED] FieldConversionDefaultImpl}
does not modify its input.
+ * The default implementation [EMAIL PROTECTED] #DEFAULT} 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.
@@ -46,4 +46,21 @@
*/
public Object sqlToJava(Object source) throws ConversionException;
+ /**
+ * A default noop implementation of the [EMAIL PROTECTED] FieldConversion}
interface.
+ */
+ public static final FieldConversion DEFAULT = new
FieldConversionDefaultImpl();
+
+ static class FieldConversionDefaultImpl implements FieldConversion
+ {
+ public Object javaToSql(final Object source) throws ConversionException
+ {
+ return source;
+ }
+
+ public Object sqlToJava(final Object source) throws ConversionException
+ {
+ return source;
+ }
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]