org.jboss.ejb.plugins.cmp.jdbc
Interface Mapper


public interface Mapper

Generally, implementations of this interface map instances of one Java type into instances of another Java type. Mappers are used in cases when instances of "enum" types are used as CMP field values. In this case, a mapper represents a mediator and translates instances of "enum" to some id when that can be stored in a column when storing data and back from id to "enum" instance when data is loaded.

Author:
Alex Loubyansky

Method Summary
 Object toColumnValue(Object fieldValue)
          This method is called when CMP field is stored.
 Object toFieldValue(Object columnValue)
          This method is called when CMP field is loaded.
 

Method Detail

toColumnValue

Object toColumnValue(Object fieldValue)
This method is called when CMP field is stored.

Parameters:
fieldValue - - CMP field value
Returns:
column value.

toFieldValue

Object toFieldValue(Object columnValue)
This method is called when CMP field is loaded.

Parameters:
columnValue - - loaded column value.
Returns:
CMP field value.


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.