org.apache.ojb.broker.metadata
Interface FieldType

All Superinterfaces:
java.io.Serializable

public interface FieldType
extends java.io.Serializable

OJB implements the mapping conventions for JDBC as specified by the JDBC 3.0 specification and this class representing the jdbc java types of the sql types mappings - e.g. VARCHAR --> String, NUMERIC --> BigDecimal (see JDBC 3.0 specification Appendix B, Data Type Conversion Tables).

We differ two types of fields, immutable (like Integer, Long, String, ...) and mutable (like Date, byte[], most SQL3 datatypes, ...).

Version:
$Id: FieldType.java 365232 2005-12-21 22:36:07Z tomdz $

Method Summary
 java.lang.Object copy(java.lang.Object fieldValue)
          Returns a copy of the specified persistent class field (e.g.
 boolean equals(java.lang.Object firstValue, java.lang.Object secondValue)
          Returns true if the field value hasn't changed.
 int getSqlType()
          Returns the sql Types of this field.
 boolean isMutable()
          Returns true if the field type is mutable, e.g. a jdbc BLOB field or jdbc TIMESTAMP field.
 void setSqlType(JdbcType jdbcType)
          Dets the associated sql field type of this field.
 

Method Detail

copy

java.lang.Object copy(java.lang.Object fieldValue)
Returns a copy of the specified persistent class field (e.g. Long, Integer,...).
NOTE: The specified field value

Parameters:
fieldValue - The field to copy.
Returns:
A copy of the field or the same instance if copying is not possible. Depends on the implementation.

equals

boolean equals(java.lang.Object firstValue,
               java.lang.Object secondValue)
Returns true if the field value hasn't changed.

Parameters:
firstValue - A field value object.
secondValue - A field value object.
Returns:
true if the field value hasn't changed.

getSqlType

int getSqlType()
Returns the sql Types of this field.


setSqlType

void setSqlType(JdbcType jdbcType)
Dets the associated sql field type of this field.

Parameters:
jdbcType - The associated JdbcType.

isMutable

boolean isMutable()
Returns true if the field type is mutable, e.g. a jdbc BLOB field or jdbc TIMESTAMP field.

Returns:


(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