com.sleepycat.je.sync
Interface RecordConverter

All Superinterfaces:
Serializable
All Known Implementing Classes:
RecordMapping

public interface RecordConverter
extends Serializable

Provides custom data conversion between records in an external table/view and raw data records in a local database.

This low-level interface is implemented by the RecordMapping class, which is normally used whenever a JE binding is available. When a binding is not available, or the RecordMapping class is not sufficient, the user may implement this interface directly.


Method Summary
 void convertExternalToLocal(Object[] externalFieldValues, DatabaseEntry localKey, DatabaseEntry localData)
          Converts an array of external record values to a local raw data record.
 void convertLocalToExternal(DatabaseEntry localKey, DatabaseEntry localData, Object[] externalFieldValues)
          Converts the local raw data record to an array of external record values.
 String[] getExternalFieldNames()
          Returns an array of the names of fields in the external RDBMS.
 Class[] getExternalFieldTypes()
          Returns an array of the types of fields in the external RDBMS.
 void initializeConverter(Class[] externalFieldTypes, String[] externalFieldNames)
          Initializes the converter with the external field/column names and data types.
 

Method Detail

initializeConverter

void initializeConverter(Class[] externalFieldTypes,
                         String[] externalFieldNames)
Initializes the converter with the external field/column names and data types. The array of external field values will correspond by inddex to the two arrays given here.


convertLocalToExternal

void convertLocalToExternal(DatabaseEntry localKey,
                            DatabaseEntry localData,
                            Object[] externalFieldValues)
Converts the local raw data record to an array of external record values.


convertExternalToLocal

void convertExternalToLocal(Object[] externalFieldValues,
                            DatabaseEntry localKey,
                            DatabaseEntry localData)
Converts an array of external record values to a local raw data record.

If localData is non-empty (DatabaseEntry.getSize() returns greater than zero), updates the existing record; otherwise, creates a new local record.


getExternalFieldTypes

Class[] getExternalFieldTypes()
Returns an array of the types of fields in the external RDBMS.

Returns:
an array of the fields' types in the external RDBMS.

getExternalFieldNames

String[] getExternalFieldNames()
Returns an array of the names of fields in the external RDBMS.

Returns:
an array of fields' names in the external RDBMS.


Copyright (c) 2004-2012 Oracle. All rights reserved.