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 SQLDBState.javaTypes2SQLTypes()
mapping to determine which SQL datatype to use when inserting the
object to prepared statement.
Method Summary |
void |
addPrimitiveToPS(java.sql.PreparedStatement ps,
java.lang.Integer index,
java.lang.Object primitive,
java.lang.reflect.Type primitiveType)
Adds the specified object at specified index in specified prepared statement. |
java.lang.Integer |
getSQLType(java.lang.Object primitive)
|
addPrimitiveToPS
void addPrimitiveToPS(java.sql.PreparedStatement ps,
java.lang.Integer index,
@Optional
java.lang.Object primitive,
java.lang.reflect.Type primitiveType)
throws java.sql.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:
java.sql.SQLException
- If something underlying throws it.
getSQLType
java.lang.Integer getSQLType(java.lang.Object primitive)