it.biobytes.ammentos.fieldtypes
Class EntityType

java.lang.Object
  extended by it.biobytes.ammentos.fieldtypes.EntityType
All Implemented Interfaces:
FieldType

public class EntityType
extends java.lang.Object
implements FieldType

Author:
davide

Constructor Summary
EntityType()
          Creates a new instance of EntityType
 
Method Summary
 java.lang.Object addValues(java.lang.Object value1, java.lang.Object value2)
          Returns the sum of the provided values, or null if summing is not possible
 java.lang.String formatValue(java.lang.Object value)
           
 java.lang.Object generateValue()
           
 java.lang.Class getMappedClass()
          Gets the underlying mappes Java class represented from elements of this type
 java.lang.Object[] getPossibleValues()
           
 boolean isNumeric()
           
 java.lang.Object loadValue(java.sql.ResultSet rs, Field field)
           
 java.lang.Object parseValue(java.lang.String str)
           
 void setParamValue(java.lang.Object fieldValue, java.sql.PreparedStatement pstmt, int paramIndex)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityType

public EntityType()
Creates a new instance of EntityType

Method Detail

parseValue

public java.lang.Object parseValue(java.lang.String str)
                            throws PersistenceException
Specified by:
parseValue in interface FieldType
Throws:
PersistenceException

loadValue

public java.lang.Object loadValue(java.sql.ResultSet rs,
                                  Field field)
                           throws java.sql.SQLException
Specified by:
loadValue in interface FieldType
Throws:
java.sql.SQLException

formatValue

public java.lang.String formatValue(java.lang.Object value)
Specified by:
formatValue in interface FieldType

setParamValue

public void setParamValue(java.lang.Object fieldValue,
                          java.sql.PreparedStatement pstmt,
                          int paramIndex)
                   throws java.sql.SQLException
Specified by:
setParamValue in interface FieldType
Throws:
java.sql.SQLException

isNumeric

public boolean isNumeric()
Specified by:
isNumeric in interface FieldType

getPossibleValues

public java.lang.Object[] getPossibleValues()
Specified by:
getPossibleValues in interface FieldType

generateValue

public java.lang.Object generateValue()
                               throws PersistenceException
Specified by:
generateValue in interface FieldType
Throws:
PersistenceException

addValues

public java.lang.Object addValues(java.lang.Object value1,
                                  java.lang.Object value2)
Returns the sum of the provided values, or null if summing is not possible

Specified by:
addValues in interface FieldType
Parameters:
value1 - First value to add
value2 - Second value to add

getMappedClass

public java.lang.Class getMappedClass()
Gets the underlying mappes Java class represented from elements of this type

Specified by:
getMappedClass in interface FieldType
Returns:
the Java class mapped from this FieldType