org.qi4j.index.sql.support.postgresql
Interface PostgreSQLTypeHelper

All Known Implementing Classes:
PostgreSQLTypeHelper.SQLTypeHelperMixin

@Mixins(value=PostgreSQLTypeHelper.SQLTypeHelperMixin.class)
public interface PostgreSQLTypeHelper

A little helper interface to convert java types to SQL types when inserting objects to prepared statements. It will first preprocess the object and possibly convert it to something else (like Character to Integer). Then it will use the SQLIndexingState#javaTypes2SQLTypes() mapping to determine which SQL datatype to use when inserting the object to prepared statement.


Nested Class Summary
static class PostgreSQLTypeHelper.SQLTypeHelperMixin
           
 
Method Summary
 void addPrimitiveToPS(PreparedStatement ps, Integer index, Object primitive, Type primitiveType)
          Adds the specified object at specified index in specified prepared statement.
 Integer getSQLType(Object primitive)
           
 

Method Detail

addPrimitiveToPS

void addPrimitiveToPS(PreparedStatement ps,
                      Integer index,
                      @Optional
                      Object primitive,
                      Type primitiveType)
                      throws SQLException
Adds the specified object at specified index in specified prepared statement.

Parameters:
ps - The prepared statement.
index - The index for the object to be inserted in prepared statemtent (> 0).
primitive - The object to insert.
primitiveType - The type of object.
Throws:
SQLException - If something underlying throws it.

getSQLType

Integer getSQLType(Object primitive)