|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectsf.qof.adapter.EnumerationAdapter
public class EnumerationAdapter
EnumerationAdapter is a generator mapping adapter for Java enumerations.
It uses enum.name() to map an enumeration to a VARCHAR and
enum.valueOf(String) to map it back.
| Constructor Summary | |
|---|---|
EnumerationAdapter()
|
|
| Method Summary | |
|---|---|
void |
generateFromResult(ResultMapping resultMapping,
net.sf.cglib.core.CodeEmitter co,
net.sf.cglib.core.Local result,
int[] indexes)
Method to map the current record of a result set or the result of a callable statement to an object on the stack. |
void |
generateFromResultSet(ResultMapping resultMapping,
net.sf.cglib.core.CodeEmitter co,
net.sf.cglib.core.Local resultSet,
String[] columns)
Method to map the current record of a result set to an object on the stack. |
void |
generateRegisterOutputParameters(ResultMapping resultMapping,
net.sf.cglib.core.CodeEmitter co,
net.sf.cglib.core.Local callableStatement,
int[] indexes)
Method to register an output parameter in a callable statement. |
void |
generateToPreparedStatement(ParameterMapping parameterMapping,
net.sf.cglib.core.CodeEmitter co,
net.sf.cglib.core.Local preparedStatement,
int[] indexes,
net.sf.cglib.core.Local indexOffset)
Method to map the object on top of the stack to a prepared statement. |
int |
getNumberOfColumns()
Returns the number of mapped columns. |
Set<Class<?>> |
getTypes()
Returns the set of mappable Java types. |
static void |
register()
Register the mapping adapter with the default name "enum". |
static void |
register(String typeName)
Register the mapping adapter with the specified name. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EnumerationAdapter()
| Method Detail |
|---|
public void generateFromResult(ResultMapping resultMapping,
net.sf.cglib.core.CodeEmitter co,
net.sf.cglib.core.Local result,
int[] indexes)
GeneratorMappingAdapterindexes defines the SQL indexes for the result set
to be used in functions such a getInt(index).
generateFromResult in interface GeneratorMappingAdapterresultMapping - the result mappingco - code emitterresult - ResultSet or CallableStatement local variableindexes - array of SQL indexes
public void generateFromResultSet(ResultMapping resultMapping,
net.sf.cglib.core.CodeEmitter co,
net.sf.cglib.core.Local resultSet,
String[] columns)
GeneratorMappingAdaptercolumns defines the SQL column name for the result set to be used
in functions such a getInt(name).
generateFromResultSet in interface GeneratorMappingAdapterresultMapping - the result mappingco - code emitterresultSet - ResultSet local variablecolumns - array of SQL column names
public void generateToPreparedStatement(ParameterMapping parameterMapping,
net.sf.cglib.core.CodeEmitter co,
net.sf.cglib.core.Local preparedStatement,
int[] indexes,
net.sf.cglib.core.Local indexOffset)
GeneratorMappingAdapterindexes defines the SQL index for the prepared statement to be used
in functions such a setInt(index, value).
generateToPreparedStatement in interface GeneratorMappingAdapterparameterMapping - the parameter mappingco - code emitterpreparedStatement - prepared statement local variableindexes - array of SQL indexesindexOffset - offset to be added to the indexes if not null
public void generateRegisterOutputParameters(ResultMapping resultMapping,
net.sf.cglib.core.CodeEmitter co,
net.sf.cglib.core.Local callableStatement,
int[] indexes)
GeneratorMappingAdapter
generateRegisterOutputParameters in interface GeneratorMappingAdapterresultMapping - the result mappingco - code emittercallableStatement - callable statement local variableindexes - array of SQL indexespublic int getNumberOfColumns()
MappingAdapter
getNumberOfColumns in interface MappingAdapterpublic Set<Class<?>> getTypes()
MappingAdapter
getTypes in interface MappingAdapterpublic static void register()
public static void register(String typeName)
typeName - type name
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||