jodd.db.type
Class NullAwareSqlType<T>

java.lang.Object
  extended by jodd.db.type.SqlType<T>
      extended by jodd.db.type.NullAwareSqlType<T>
Direct Known Subclasses:
BooleanSqlType, ByteSqlType, CharacterSqlType, DoubleSqlType, FloatSqlType, IntegerSqlType, LongSqlType, ShortSqlType

public abstract class NullAwareSqlType<T>
extends SqlType<T>

Null-aware sql types.


Field Summary
 
Fields inherited from class jodd.db.type.SqlType
sqlType
 
Constructor Summary
NullAwareSqlType()
           
 
Method Summary
<E> E
readValue(java.sql.ResultSet rs, int index, java.lang.Class<E> destinationType, int dbSqlType)
          Detects if there was a null reading, never less the real value.
 void storeValue(java.sql.PreparedStatement st, int index, java.lang.Object value, int dbSqlType)
          Detects null while storing value into the database.
 
Methods inherited from class jodd.db.type.SqlType
get, prepareGetValue, set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullAwareSqlType

public NullAwareSqlType()
Method Detail

readValue

public <E> E readValue(java.sql.ResultSet rs,
                       int index,
                       java.lang.Class<E> destinationType,
                       int dbSqlType)
            throws java.sql.SQLException
Detects if there was a null reading, never less the real value.

Overrides:
readValue in class SqlType<T>
Parameters:
rs - result set
index - database column index
destinationType - property type
dbSqlType - hint for column sql type value
Throws:
java.sql.SQLException

storeValue

public void storeValue(java.sql.PreparedStatement st,
                       int index,
                       java.lang.Object value,
                       int dbSqlType)
                throws java.sql.SQLException
Detects null while storing value into the database.

Overrides:
storeValue in class SqlType<T>
Throws:
java.sql.SQLException


Copyright © 2003-2010 Jodd Team