org.melati.poem
Interface SQLType

Package class diagram package SQLType
All Known Subinterfaces:
SQLPoemType
All Known Implementing Classes:
AtomPoemType, BasePoemType, BigDecimalPoemType, BinaryPoemType, BooleanPoemType, ColumnTypePoemType, DatePoemType, DeletedPoemType, DisplayLevelPoemType, DoublePoemType, FixedPointAtomPoemType, IndexPoemType, IntegerPoemType, IntegrityFixPoemType, LongPoemType, MSAccess.MSAccessStringPoemType, MySQL.BlobPoemType, MySQL.MySQLBooleanPoemType, MySQL.MySQLStringPoemType, Oracle.OracleBooleanPoemType, Oracle.OracleStringPoemType, PasswordPoemType, ReferencePoemType, RestrictedReferencePoemType, SearchabilityPoemType, SizedAtomPoemType, SQLServer.SQLServerBooleanPoemType, StringPoemType, TimestampPoemType, TroidPoemType

public interface SQLType

A native SQL Field datatype.

Author:
WilliamC At paneris.org

Method Summary
 Object getRaw(ResultSet rs, int col)
          Return an object as delivered by the database.
 String quotedRaw(Object raw)
          Quoting a raw value, if appropriate, for the Dbms.
 void setRaw(PreparedStatement ps, int col, Object cooked)
          Set a column of a PreparedStatement to the passed in value.
 String sqlDefaultValue(Dbms dbms)
          Used to set a not null value when creating a non nullable column.
 String sqlDefinition(Dbms dbms)
          SQL type definition with nullability.
 int sqlTypeCode()
           
 String sqlTypeDefinition(Dbms dbms)
          SQL type definition without nullability.
 

Method Detail

sqlTypeCode

int sqlTypeCode()
Returns:
The SQL92 ANSI code for this type.

sqlDefinition

String sqlDefinition(Dbms dbms)
SQL type definition with nullability. eg: STRING NOT NULL

Parameters:
dbms - the DBMS
Returns:
the DBMS specific SQL snippet

sqlDefaultValue

String sqlDefaultValue(Dbms dbms)
Used to set a not null value when creating a non nullable column.

Parameters:
dbms - the dbms the value is suitable for
Returns:
a String suitable for substitution in UPDATE table SET field = ?

sqlTypeDefinition

String sqlTypeDefinition(Dbms dbms)
SQL type definition without nullability. eg: STRING

Parameters:
dbms - the DBMS
Returns:
the DBMS specific SQL snippet

quotedRaw

String quotedRaw(Object raw)
Quoting a raw value, if appropriate, for the Dbms.

numbers and booleans are not quoted for most dbms'.

Parameters:
raw - sql value
Returns:
the raw value with quotes if appropriate for the dbms

getRaw

Object getRaw(ResultSet rs,
              int col)
              throws TypeMismatchPoemException,
                     ValidationPoemException,
                     ParsingPoemException
Return an object as delivered by the database.

Parameters:
rs - the Resultset containing the value
col - the column withing the ResultSet to read
Returns:
the value as an Object
Throws:
TypeMismatchPoemException
ValidationPoemException
ParsingPoemException

setRaw

void setRaw(PreparedStatement ps,
            int col,
            Object cooked)
            throws TypeMismatchPoemException
Set a column of a PreparedStatement to the passed in value.

Parameters:
ps - the Prepared Statement to modify
col - the column within the PreparedStatement
cooked - the value to set
Throws:
TypeMismatchPoemException


Copyright © 2000-2010 PanEris. All Rights Reserved.