org.objectweb.jorm.mapper.rdb.adapter
Class BasicRdbAdapter

java.lang.Object
  extended byorg.objectweb.jorm.mapper.rdb.adapter.BasicRdbAdapter
All Implemented Interfaces:
RdbAdapter
Direct Known Subclasses:
Db2Adapter, FirebirdAdapter, HsqlAdapter, MckoiAdapter, MysqlAdapter, OracleAdapter, PostgresAdapter, SapdbAdapter, SqlserverAdapter, SybaseAdapter

public class BasicRdbAdapter
extends java.lang.Object
implements RdbAdapter


Constructor Summary
BasicRdbAdapter()
           
 
Method Summary
 boolean existSequence(java.sql.Connection connection, java.lang.String seqName)
           
 boolean existTable(java.sql.Connection connection, java.lang.String tableName)
           
 int fetchResultSetSize(java.sql.ResultSet rs)
          This calculates the size of a result set.
 java.math.BigDecimal getBigDecimal(java.sql.ResultSet rs, int idx)
           
 java.math.BigInteger getBigInteger(java.sql.ResultSet rs, int idx)
           
 boolean getBoolean(java.sql.ResultSet rs, int idx)
           
 byte getByte(java.sql.ResultSet rs, int idx)
           
 byte[] getByteArray(java.sql.ResultSet rs, int idx)
           
protected  java.lang.String getCACHEkeyWord()
           
 char getChar(java.sql.ResultSet rs, int idx)
           
static char[] getCharArray(java.lang.Object o)
           
 char[] getCharArray(java.sql.ResultSet rs, int idx)
           
 java.lang.String getConcatExpression(java.lang.String op1, java.lang.String op2)
           
 java.lang.String getCreateSequence(java.lang.String seqName)
           
 java.lang.String getCreateSequence(java.lang.String seqName, java.lang.Integer startid, java.lang.Integer inc, java.lang.Integer cache)
          CREATE [ TEMPORARY | TEMP ] SEQUENCE name [ INCREMENT [ BY ] increment ] [ MINVALUE minvalue | NO MINVALUE ] [ MAXVALUE maxvalue | NO MAXVALUE ] [ START [ WITH ] start ] [ CACHE cache ] [ [ NO ] CYCLE ]
 java.util.Date getDate(java.sql.ResultSet rs, int idx)
           
 java.util.Date getDate(java.sql.ResultSet rs, int idx, java.lang.String sqlColumnType)
           
 double getDouble(java.sql.ResultSet rs, int idx)
           
 java.lang.String getFirstLocateExpression(java.lang.String substring, java.lang.String instring)
          Returns the expression for searching the position of the first occurrence of a substring in a string.
 float getFloat(java.sql.ResultSet rs, int idx)
           
protected  void getFromClause(JoinedTable jtMain, JoinedTable jt, JoinedTable.Join join, java.lang.StringBuffer sb)
           
protected  void getFromClause(JoinedTable jt, java.lang.StringBuffer sb)
           
protected  java.lang.String getINCREMENTkeyWord()
           
 java.lang.String getIndexedLocateExpression(java.lang.String instring, java.lang.String substring, java.lang.String fromIndex)
          Returns the expression for searching the position of the first occurrence of a substring in a string starting from a given index.
 int getInt(java.sql.ResultSet rs, int idx)
           
 long getLong(java.sql.ResultSet rs, int idx)
           
 java.lang.String getNextValInSequence(java.lang.String seqName)
           
 java.lang.Boolean getOboolean(java.sql.ResultSet rs, int idx)
           
 java.lang.Byte getObyte(java.sql.ResultSet rs, int idx)
           
 java.lang.Character getOchar(java.sql.ResultSet rs, int idx)
           
 java.lang.Double getOdouble(java.sql.ResultSet rs, int idx)
           
 java.lang.Float getOfloat(java.sql.ResultSet rs, int idx)
           
 java.lang.Integer getOint(java.sql.ResultSet rs, int idx)
           
 java.lang.Long getOlong(java.sql.ResultSet rs, int idx)
           
 java.lang.Short getOshort(java.sql.ResultSet rs, int idx)
           
 java.lang.String getQuery(java.lang.String selectClause, java.util.List jts, java.lang.String whereclause)
           
 java.io.Serializable getSerialized(java.sql.ResultSet rs, int idx)
           
 short getShort(java.sql.ResultSet rs, int idx)
           
 java.lang.String getSqlGetterName(PType pt, java.lang.String resultSet, int idx)
          This method returns the sql getter method associated to the PType specified in parameter.
 java.lang.String getSqlGetterName(PType pt, java.lang.String resultSet, int idx, java.lang.String sqlColumnType)
          This method returns the sql getter method associated to the PType specified in parameter.
 java.lang.String getSqlSetterName(PType pt, java.lang.String value, int idx)
          This method returns the sql setter method associated to the PType specified in parameter.
 java.lang.String getSqlSetterName(PType pt, java.lang.String value, int idx, java.lang.String sqlColumnType)
          This method returns the sql setter method associated to the PType specified in parameter.
 java.lang.String getSqlType(PType pt, boolean usedInPK, int size)
          This method returns the SQL type linked to the PType specified in parameter.
 int getSqlTypeCode(PType pt)
          This methods return the SQL type code linked to the PType specified in parameter.
 int getSqlTypeCode(PType pt, java.lang.String sqlColumnType)
          This methods return the SQL type code linked to the PType specified in parameter.
protected  java.lang.String getSTARTkeyWord()
           
 java.lang.String getString(java.sql.ResultSet rs, int idx)
           
 java.lang.String getSubqueryAlias()
          In the case the subquery needs to be aliased (Postgres), returns a string to be appended to the subquery.
 java.lang.String getSubstringName()
           
 java.lang.String getValueAsSQLString(boolean value)
          This method returns a String value that represents a boolean value.
 java.lang.String getValueAsSQLString(byte value)
          This method returns a String value that represents a byte value.
 java.lang.String getValueAsSQLString(char value)
          This method returns a String value that represents a char value.
 java.lang.String getValueAsSQLString(double value)
          This method returns a String value that represents a double value.
 java.lang.String getValueAsSQLString(float value)
          This method returns a String value that represents a float value.
 java.lang.String getValueAsSQLString(int value)
          This method returns a String value that represents a int value.
 java.lang.String getValueAsSQLString(long value)
          This method returns a String value that represents a long value.
 java.lang.String getValueAsSQLString(java.lang.Object value, PType type)
          This method returns a String value that represents a value.
 java.lang.String getValueAsSQLString(short value)
          This method returns a String value that represents a short value.
protected  void getWhereClause(java.util.List jts, java.lang.StringBuffer sb, java.lang.String whereclause)
           
 java.lang.String handleOrderBy(java.lang.String query)
           
 void setBigDecimal(java.sql.PreparedStatement ps, int idx, java.math.BigDecimal o)
           
 void setBigInteger(java.sql.PreparedStatement ps, int idx, java.math.BigInteger o)
           
 void setBoolean(java.sql.PreparedStatement ps, int idx, boolean o)
           
 void setByte(java.sql.PreparedStatement ps, int idx, byte o)
           
 void setByteArray(java.sql.PreparedStatement ps, int idx, byte[] o)
           
 void setChar(java.sql.PreparedStatement ps, int idx, char c)
           
 void setCharArray(java.sql.PreparedStatement ps, int idx, char[] o)
           
 void setDate(java.sql.PreparedStatement ps, int idx, java.util.Date o, java.lang.String columnType)
           
 void setDouble(java.sql.PreparedStatement ps, int idx, double o)
           
 void setFloat(java.sql.PreparedStatement ps, int idx, float o)
           
 void setInt(java.sql.PreparedStatement ps, int idx, int o)
           
 void setLong(java.sql.PreparedStatement ps, int idx, long o)
           
 void setOboolean(java.sql.PreparedStatement ps, int idx, java.lang.Boolean o)
           
 void setObyte(java.sql.PreparedStatement ps, int idx, java.lang.Byte o)
           
 void setOchar(java.sql.PreparedStatement ps, int idx, java.lang.Character o)
           
 void setOdouble(java.sql.PreparedStatement ps, int idx, java.lang.Double o)
           
 void setOfloat(java.sql.PreparedStatement ps, int idx, java.lang.Float o)
           
 void setOint(java.sql.PreparedStatement ps, int idx, java.lang.Integer o)
           
 void setOlong(java.sql.PreparedStatement ps, int idx, java.lang.Long o)
           
 void setOshort(java.sql.PreparedStatement ps, int idx, java.lang.Short o)
           
 void setSerialized(java.sql.PreparedStatement ps, int idx, java.io.Serializable o)
           
 void setShort(java.sql.PreparedStatement ps, int idx, short o)
           
 void setString(java.sql.PreparedStatement ps, int idx, java.lang.String o)
           
 boolean supportBatchPreparedStatement()
          Indicates if the driver supports the batch of PreparedStatement
 void writeTableAlias(java.lang.String alias, java.lang.StringBuffer sb)
          Used to write table aliases, for which the syntax may vary (use of 'as', except for Oracle)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicRdbAdapter

public BasicRdbAdapter()
Method Detail

supportBatchPreparedStatement

public boolean supportBatchPreparedStatement()
Description copied from interface: RdbAdapter
Indicates if the driver supports the batch of PreparedStatement

Specified by:
supportBatchPreparedStatement in interface RdbAdapter

getSqlTypeCode

public int getSqlTypeCode(PType pt)
                   throws PExceptionProtocol
This methods return the SQL type code linked to the PType specified in parameter.

Specified by:
getSqlTypeCode in interface RdbAdapter
Returns:
An int constant defined in the java.sql.Types class
Throws:
PExceptionProtocol

getSqlTypeCode

public int getSqlTypeCode(PType pt,
                          java.lang.String sqlColumnType)
                   throws PExceptionProtocol
This methods return the SQL type code linked to the PType specified in parameter.

Specified by:
getSqlTypeCode in interface RdbAdapter
Returns:
An int constant defined in the java.sql.Types class
Throws:
PExceptionProtocol

getSqlType

public java.lang.String getSqlType(PType pt,
                                   boolean usedInPK,
                                   int size)
                            throws PExceptionProtocol
Description copied from interface: RdbAdapter
This method returns the SQL type linked to the PType specified in parameter.

Specified by:
getSqlType in interface RdbAdapter
Throws:
PExceptionProtocol

getSqlGetterName

public java.lang.String getSqlGetterName(PType pt,
                                         java.lang.String resultSet,
                                         int idx)
                                  throws PExceptionProtocol
Description copied from interface: RdbAdapter
This method returns the sql getter method associated to the PType specified in parameter. The returned string is the fetching of the value on the resultset to the specified index: "@resultSet.getBoolean(@idx)"

Specified by:
getSqlGetterName in interface RdbAdapter
Throws:
PExceptionProtocol

getSqlGetterName

public java.lang.String getSqlGetterName(PType pt,
                                         java.lang.String resultSet,
                                         int idx,
                                         java.lang.String sqlColumnType)
                                  throws PExceptionProtocol
Description copied from interface: RdbAdapter
This method returns the sql getter method associated to the PType specified in parameter. The returned string is the fetching of the value on the resultset to the specified index: "@resultSet.getBoolean(@idx)"

Specified by:
getSqlGetterName in interface RdbAdapter
Throws:
PExceptionProtocol

getSqlSetterName

public java.lang.String getSqlSetterName(PType pt,
                                         java.lang.String value,
                                         int idx)
                                  throws PExceptionProtocol
Description copied from interface: RdbAdapter
This method returns the sql setter method associated to the PType specified in parameter. The returned string is the assignment of the value to the specified index: "setBoolean(@idx, @value)"

Specified by:
getSqlSetterName in interface RdbAdapter
Throws:
PExceptionProtocol

getSqlSetterName

public java.lang.String getSqlSetterName(PType pt,
                                         java.lang.String value,
                                         int idx,
                                         java.lang.String sqlColumnType)
                                  throws PExceptionProtocol
Description copied from interface: RdbAdapter
This method returns the sql setter method associated to the PType specified in parameter. The returned string is the assignment of the value to the specified index: "setBoolean(@idx, @value)"

Specified by:
getSqlSetterName in interface RdbAdapter
Throws:
PExceptionProtocol

fetchResultSetSize

public int fetchResultSetSize(java.sql.ResultSet rs)
                       throws java.sql.SQLException
This calculates the size of a result set. If this feature is not supported by a database or its jdbc driver, this method returns -1.

Specified by:
fetchResultSetSize in interface RdbAdapter
Parameters:
rs - the result set which the size must be returned
Throws:
java.sql.SQLException

getValueAsSQLString

public java.lang.String getValueAsSQLString(java.lang.Object value,
                                            PType type)
Description copied from interface: RdbAdapter
This method returns a String value that represents a value. This method can be used for the constant parameters of SQL queries.

Specified by:
getValueAsSQLString in interface RdbAdapter
Parameters:
value -
type - is the PType of the @value

getValueAsSQLString

public java.lang.String getValueAsSQLString(boolean value)
Description copied from interface: RdbAdapter
This method returns a String value that represents a boolean value. This method can be used for the constant parameters of SQL queries.

Specified by:
getValueAsSQLString in interface RdbAdapter

getValueAsSQLString

public java.lang.String getValueAsSQLString(byte value)
Description copied from interface: RdbAdapter
This method returns a String value that represents a byte value. This method can be used for the constant parameters of SQL queries.

Specified by:
getValueAsSQLString in interface RdbAdapter

getValueAsSQLString

public java.lang.String getValueAsSQLString(char value)
Description copied from interface: RdbAdapter
This method returns a String value that represents a char value. This method can be used for the constant parameters of SQL queries.

Specified by:
getValueAsSQLString in interface RdbAdapter

getValueAsSQLString

public java.lang.String getValueAsSQLString(short value)
Description copied from interface: RdbAdapter
This method returns a String value that represents a short value. This method can be used for the constant parameters of SQL queries.

Specified by:
getValueAsSQLString in interface RdbAdapter

getValueAsSQLString

public java.lang.String getValueAsSQLString(int value)
Description copied from interface: RdbAdapter
This method returns a String value that represents a int value. This method can be used for the constant parameters of SQL queries.

Specified by:
getValueAsSQLString in interface RdbAdapter

getValueAsSQLString

public java.lang.String getValueAsSQLString(long value)
Description copied from interface: RdbAdapter
This method returns a String value that represents a long value. This method can be used for the constant parameters of SQL queries.

Specified by:
getValueAsSQLString in interface RdbAdapter

getValueAsSQLString

public java.lang.String getValueAsSQLString(float value)
Description copied from interface: RdbAdapter
This method returns a String value that represents a float value. This method can be used for the constant parameters of SQL queries.

Specified by:
getValueAsSQLString in interface RdbAdapter

getValueAsSQLString

public java.lang.String getValueAsSQLString(double value)
Description copied from interface: RdbAdapter
This method returns a String value that represents a double value. This method can be used for the constant parameters of SQL queries.

Specified by:
getValueAsSQLString in interface RdbAdapter

getBoolean

public boolean getBoolean(java.sql.ResultSet rs,
                          int idx)
                   throws java.sql.SQLException
Specified by:
getBoolean in interface RdbAdapter
Throws:
java.sql.SQLException

getOboolean

public java.lang.Boolean getOboolean(java.sql.ResultSet rs,
                                     int idx)
                              throws java.sql.SQLException
Specified by:
getOboolean in interface RdbAdapter
Throws:
java.sql.SQLException

getChar

public char getChar(java.sql.ResultSet rs,
                    int idx)
             throws java.sql.SQLException
Specified by:
getChar in interface RdbAdapter
Throws:
java.sql.SQLException

getOchar

public java.lang.Character getOchar(java.sql.ResultSet rs,
                                    int idx)
                             throws java.sql.SQLException
Specified by:
getOchar in interface RdbAdapter
Throws:
java.sql.SQLException

getByte

public byte getByte(java.sql.ResultSet rs,
                    int idx)
             throws java.sql.SQLException
Specified by:
getByte in interface RdbAdapter
Throws:
java.sql.SQLException

getObyte

public java.lang.Byte getObyte(java.sql.ResultSet rs,
                               int idx)
                        throws java.sql.SQLException
Specified by:
getObyte in interface RdbAdapter
Throws:
java.sql.SQLException

getShort

public short getShort(java.sql.ResultSet rs,
                      int idx)
               throws java.sql.SQLException
Specified by:
getShort in interface RdbAdapter
Throws:
java.sql.SQLException

getOshort

public java.lang.Short getOshort(java.sql.ResultSet rs,
                                 int idx)
                          throws java.sql.SQLException
Specified by:
getOshort in interface RdbAdapter
Throws:
java.sql.SQLException

getInt

public int getInt(java.sql.ResultSet rs,
                  int idx)
           throws java.sql.SQLException
Specified by:
getInt in interface RdbAdapter
Throws:
java.sql.SQLException

getOint

public java.lang.Integer getOint(java.sql.ResultSet rs,
                                 int idx)
                          throws java.sql.SQLException
Specified by:
getOint in interface RdbAdapter
Throws:
java.sql.SQLException

getLong

public long getLong(java.sql.ResultSet rs,
                    int idx)
             throws java.sql.SQLException
Specified by:
getLong in interface RdbAdapter
Throws:
java.sql.SQLException

getOlong

public java.lang.Long getOlong(java.sql.ResultSet rs,
                               int idx)
                        throws java.sql.SQLException
Specified by:
getOlong in interface RdbAdapter
Throws:
java.sql.SQLException

getFloat

public float getFloat(java.sql.ResultSet rs,
                      int idx)
               throws java.sql.SQLException
Specified by:
getFloat in interface RdbAdapter
Throws:
java.sql.SQLException

getOfloat

public java.lang.Float getOfloat(java.sql.ResultSet rs,
                                 int idx)
                          throws java.sql.SQLException
Specified by:
getOfloat in interface RdbAdapter
Throws:
java.sql.SQLException

getDouble

public double getDouble(java.sql.ResultSet rs,
                        int idx)
                 throws java.sql.SQLException
Specified by:
getDouble in interface RdbAdapter
Throws:
java.sql.SQLException

getOdouble

public java.lang.Double getOdouble(java.sql.ResultSet rs,
                                   int idx)
                            throws java.sql.SQLException
Specified by:
getOdouble in interface RdbAdapter
Throws:
java.sql.SQLException

getString

public java.lang.String getString(java.sql.ResultSet rs,
                                  int idx)
                           throws java.sql.SQLException
Specified by:
getString in interface RdbAdapter
Throws:
java.sql.SQLException

getDate

public java.util.Date getDate(java.sql.ResultSet rs,
                              int idx)
                       throws java.sql.SQLException
Specified by:
getDate in interface RdbAdapter
Throws:
java.sql.SQLException

getDate

public java.util.Date getDate(java.sql.ResultSet rs,
                              int idx,
                              java.lang.String sqlColumnType)
                       throws java.sql.SQLException
Specified by:
getDate in interface RdbAdapter
Throws:
java.sql.SQLException

getCharArray

public char[] getCharArray(java.sql.ResultSet rs,
                           int idx)
                    throws java.sql.SQLException
Specified by:
getCharArray in interface RdbAdapter
Throws:
java.sql.SQLException

getByteArray

public byte[] getByteArray(java.sql.ResultSet rs,
                           int idx)
                    throws java.sql.SQLException
Specified by:
getByteArray in interface RdbAdapter
Throws:
java.sql.SQLException

getSerialized

public java.io.Serializable getSerialized(java.sql.ResultSet rs,
                                          int idx)
                                   throws java.sql.SQLException,
                                          java.io.IOException,
                                          java.lang.ClassNotFoundException
Specified by:
getSerialized in interface RdbAdapter
Throws:
java.sql.SQLException
java.io.IOException
java.lang.ClassNotFoundException

getBigInteger

public java.math.BigInteger getBigInteger(java.sql.ResultSet rs,
                                          int idx)
                                   throws java.sql.SQLException
Throws:
java.sql.SQLException

getBigDecimal

public java.math.BigDecimal getBigDecimal(java.sql.ResultSet rs,
                                          int idx)
                                   throws java.sql.SQLException
Specified by:
getBigDecimal in interface RdbAdapter
Throws:
java.sql.SQLException

setBoolean

public void setBoolean(java.sql.PreparedStatement ps,
                       int idx,
                       boolean o)
                throws java.sql.SQLException
Specified by:
setBoolean in interface RdbAdapter
Throws:
java.sql.SQLException

setOboolean

public void setOboolean(java.sql.PreparedStatement ps,
                        int idx,
                        java.lang.Boolean o)
                 throws java.sql.SQLException
Specified by:
setOboolean in interface RdbAdapter
Throws:
java.sql.SQLException

setChar

public void setChar(java.sql.PreparedStatement ps,
                    int idx,
                    char c)
             throws java.sql.SQLException
Specified by:
setChar in interface RdbAdapter
Throws:
java.sql.SQLException

setOchar

public void setOchar(java.sql.PreparedStatement ps,
                     int idx,
                     java.lang.Character o)
              throws java.sql.SQLException
Specified by:
setOchar in interface RdbAdapter
Throws:
java.sql.SQLException

setByte

public void setByte(java.sql.PreparedStatement ps,
                    int idx,
                    byte o)
             throws java.sql.SQLException
Specified by:
setByte in interface RdbAdapter
Throws:
java.sql.SQLException

setObyte

public void setObyte(java.sql.PreparedStatement ps,
                     int idx,
                     java.lang.Byte o)
              throws java.sql.SQLException
Specified by:
setObyte in interface RdbAdapter
Throws:
java.sql.SQLException

setShort

public void setShort(java.sql.PreparedStatement ps,
                     int idx,
                     short o)
              throws java.sql.SQLException
Specified by:
setShort in interface RdbAdapter
Throws:
java.sql.SQLException

setOshort

public void setOshort(java.sql.PreparedStatement ps,
                      int idx,
                      java.lang.Short o)
               throws java.sql.SQLException
Specified by:
setOshort in interface RdbAdapter
Throws:
java.sql.SQLException

setInt

public void setInt(java.sql.PreparedStatement ps,
                   int idx,
                   int o)
            throws java.sql.SQLException
Specified by:
setInt in interface RdbAdapter
Throws:
java.sql.SQLException

setOint

public void setOint(java.sql.PreparedStatement ps,
                    int idx,
                    java.lang.Integer o)
             throws java.sql.SQLException
Specified by:
setOint in interface RdbAdapter
Throws:
java.sql.SQLException

setLong

public void setLong(java.sql.PreparedStatement ps,
                    int idx,
                    long o)
             throws java.sql.SQLException
Specified by:
setLong in interface RdbAdapter
Throws:
java.sql.SQLException

setOlong

public void setOlong(java.sql.PreparedStatement ps,
                     int idx,
                     java.lang.Long o)
              throws java.sql.SQLException
Specified by:
setOlong in interface RdbAdapter
Throws:
java.sql.SQLException

setFloat

public void setFloat(java.sql.PreparedStatement ps,
                     int idx,
                     float o)
              throws java.sql.SQLException
Specified by:
setFloat in interface RdbAdapter
Throws:
java.sql.SQLException

setOfloat

public void setOfloat(java.sql.PreparedStatement ps,
                      int idx,
                      java.lang.Float o)
               throws java.sql.SQLException
Specified by:
setOfloat in interface RdbAdapter
Throws:
java.sql.SQLException

setDouble

public void setDouble(java.sql.PreparedStatement ps,
                      int idx,
                      double o)
               throws java.sql.SQLException
Specified by:
setDouble in interface RdbAdapter
Throws:
java.sql.SQLException

setOdouble

public void setOdouble(java.sql.PreparedStatement ps,
                       int idx,
                       java.lang.Double o)
                throws java.sql.SQLException
Specified by:
setOdouble in interface RdbAdapter
Throws:
java.sql.SQLException

setString

public void setString(java.sql.PreparedStatement ps,
                      int idx,
                      java.lang.String o)
               throws java.sql.SQLException
Specified by:
setString in interface RdbAdapter
Throws:
java.sql.SQLException

setDate

public void setDate(java.sql.PreparedStatement ps,
                    int idx,
                    java.util.Date o,
                    java.lang.String columnType)
             throws java.sql.SQLException
Specified by:
setDate in interface RdbAdapter
Throws:
java.sql.SQLException

setCharArray

public void setCharArray(java.sql.PreparedStatement ps,
                         int idx,
                         char[] o)
                  throws java.sql.SQLException
Specified by:
setCharArray in interface RdbAdapter
Throws:
java.sql.SQLException

setByteArray

public void setByteArray(java.sql.PreparedStatement ps,
                         int idx,
                         byte[] o)
                  throws java.sql.SQLException
Specified by:
setByteArray in interface RdbAdapter
Throws:
java.sql.SQLException

setBigInteger

public void setBigInteger(java.sql.PreparedStatement ps,
                          int idx,
                          java.math.BigInteger o)
                   throws java.sql.SQLException
Throws:
java.sql.SQLException

setBigDecimal

public void setBigDecimal(java.sql.PreparedStatement ps,
                          int idx,
                          java.math.BigDecimal o)
                   throws java.sql.SQLException
Specified by:
setBigDecimal in interface RdbAdapter
Throws:
java.sql.SQLException

setSerialized

public void setSerialized(java.sql.PreparedStatement ps,
                          int idx,
                          java.io.Serializable o)
                   throws java.sql.SQLException,
                          java.io.IOException
Specified by:
setSerialized in interface RdbAdapter
Throws:
java.sql.SQLException
java.io.IOException

getSubstringName

public java.lang.String getSubstringName()
Specified by:
getSubstringName in interface RdbAdapter

getConcatExpression

public java.lang.String getConcatExpression(java.lang.String op1,
                                            java.lang.String op2)
Specified by:
getConcatExpression in interface RdbAdapter

getFirstLocateExpression

public java.lang.String getFirstLocateExpression(java.lang.String substring,
                                                 java.lang.String instring)
                                          throws PException
Description copied from interface: RdbAdapter
Returns the expression for searching the position of the first occurrence of a substring in a string.

Two main syntaxes are found: position(substr in str) and instr(str, substr).

Specified by:
getFirstLocateExpression in interface RdbAdapter
Parameters:
substring - The substring searched
instring - The string in which to search the substring
Returns:
The corresponding relational expression.
Throws:
PException

getIndexedLocateExpression

public java.lang.String getIndexedLocateExpression(java.lang.String instring,
                                                   java.lang.String substring,
                                                   java.lang.String fromIndex)
                                            throws PException
Description copied from interface: RdbAdapter
Returns the expression for searching the position of the first occurrence of a substring in a string starting from a given index.

Two main syntaxes are found: instr() and locate()

Specified by:
getIndexedLocateExpression in interface RdbAdapter
Parameters:
instring - The string in which to search the substring
substring - The substring searched
fromIndex - The index from which to start searching
Returns:
The corresponding relational expression.
Throws:
PException

getQuery

public java.lang.String getQuery(java.lang.String selectClause,
                                 java.util.List jts,
                                 java.lang.String whereclause)
Specified by:
getQuery in interface RdbAdapter

getFromClause

protected void getFromClause(JoinedTable jt,
                             java.lang.StringBuffer sb)

writeTableAlias

public void writeTableAlias(java.lang.String alias,
                            java.lang.StringBuffer sb)
Description copied from interface: RdbAdapter
Used to write table aliases, for which the syntax may vary (use of 'as', except for Oracle)

Specified by:
writeTableAlias in interface RdbAdapter
Parameters:
alias - The table alias
sb - The StringBuffer into which to write the alias.

handleOrderBy

public java.lang.String handleOrderBy(java.lang.String query)
Specified by:
handleOrderBy in interface RdbAdapter

getCreateSequence

public java.lang.String getCreateSequence(java.lang.String seqName)
                                   throws java.lang.UnsupportedOperationException
Specified by:
getCreateSequence in interface RdbAdapter
Throws:
java.lang.UnsupportedOperationException

getNextValInSequence

public java.lang.String getNextValInSequence(java.lang.String seqName)
Specified by:
getNextValInSequence in interface RdbAdapter

existTable

public boolean existTable(java.sql.Connection connection,
                          java.lang.String tableName)
                   throws java.sql.SQLException
Specified by:
existTable in interface RdbAdapter
Throws:
java.sql.SQLException

existSequence

public boolean existSequence(java.sql.Connection connection,
                             java.lang.String seqName)
                      throws java.sql.SQLException
Specified by:
existSequence in interface RdbAdapter
Throws:
java.sql.SQLException

getFromClause

protected void getFromClause(JoinedTable jtMain,
                             JoinedTable jt,
                             JoinedTable.Join join,
                             java.lang.StringBuffer sb)

getWhereClause

protected void getWhereClause(java.util.List jts,
                              java.lang.StringBuffer sb,
                              java.lang.String whereclause)

getCharArray

public static char[] getCharArray(java.lang.Object o)
                           throws java.lang.Exception
Throws:
java.lang.Exception

getSubqueryAlias

public java.lang.String getSubqueryAlias()
Description copied from interface: RdbAdapter
In the case the subquery needs to be aliased (Postgres), returns a string to be appended to the subquery.

Specified by:
getSubqueryAlias in interface RdbAdapter
Returns:
the String to be appended to the subquery

getCreateSequence

public java.lang.String getCreateSequence(java.lang.String seqName,
                                          java.lang.Integer startid,
                                          java.lang.Integer inc,
                                          java.lang.Integer cache)
                                   throws java.lang.UnsupportedOperationException
CREATE [ TEMPORARY | TEMP ] SEQUENCE name [ INCREMENT [ BY ] increment ] [ MINVALUE minvalue | NO MINVALUE ] [ MAXVALUE maxvalue | NO MAXVALUE ] [ START [ WITH ] start ] [ CACHE cache ] [ [ NO ] CYCLE ]

Specified by:
getCreateSequence in interface RdbAdapter
Parameters:
seqName -
startid -
inc -
Returns:
Throws:
java.lang.UnsupportedOperationException

getINCREMENTkeyWord

protected java.lang.String getINCREMENTkeyWord()

getSTARTkeyWord

protected java.lang.String getSTARTkeyWord()

getCACHEkeyWord

protected java.lang.String getCACHEkeyWord()