org.apache.ojb.broker.platforms
Class PlatformPostgreSQLImpl

java.lang.Object
  extended by org.apache.ojb.broker.platforms.PlatformDefaultImpl
      extended by org.apache.ojb.broker.platforms.PlatformPostgreSQLImpl
All Implemented Interfaces:
JoinSyntaxTypes, Platform

public class PlatformPostgreSQLImpl
extends PlatformDefaultImpl

This class extends PlatformDefaultImpl and defines specific behavior for the PostgreSQL platform.

Many of the database sequence specific properties can be specified using custom attributes within the sequence-manager element.
The database sequence specific properties are generally speaking, see database user guide for detailed description.

Implementation configuration properties:

Property Key Property Values
sequenceStart DEPRECATED. Database sequence specific property.
Specifies the first sequence number to be generated. Allowed: 1 or greater.
seq.start Database sequence specific property.
Specifies the first sequence number to be generated. Allowed: 1 or greater.
seq.incrementBy Database sequence specific property.
Specifies the interval between sequence numbers. This value can be any positive or negative integer, but it cannot be 0.
seq.maxValue Database sequence specific property.
Set max value for sequence numbers.
seq.minValue Database sequence specific property.
Set min value for sequence numbers.
seq.cycle Database sequence specific property.
If true, specifies that the sequence continues to generate values after reaching either its maximum or minimum value.
If false, specifies that the sequence cannot generate more values after reaching its maximum or minimum value.
seq.cache Database sequence specific property.
Specifies how many values of the sequence Oracle preallocates and keeps in memory for faster access. Allowed values: 2 or greater. If set 0, an explicite nocache expression will be set.
seq.order Database sequence specific property.
If set true, guarantees that sequence numbers are generated in order of request.
If false, a no order expression will be set.

Version:
$Id: PlatformPostgreSQLImpl.java 365232 2005-12-21 22:36:07Z tomdz $
Author:
Thomas Mahler

Field Summary
 
Fields inherited from interface org.apache.ojb.broker.accesslayer.JoinSyntaxTypes
ORACLE_JOIN_SYNTAX, SQL92_JOIN_SYNTAX, SQL92_NOPAREN_JOIN_SYNTAX, SYBASE_JOIN_SYNTAX
 
Constructor Summary
PlatformPostgreSQLImpl()
           
 
Method Summary
 void addPagingSql(java.lang.StringBuffer anSqlString)
          Add the LIMIT or equivalent to the SQL SQL-Paging is not yet supported
 int bindPagingParameters(java.sql.PreparedStatement ps, int index, int startAt, int endAt)
          Bind the Paging Parameters SQL-Paging is not yet supported
 java.lang.String createSequenceQuery(java.lang.String sequenceName)
          Override this method to enable database based sequence generation
 java.lang.String createSequenceQuery(java.lang.String sequenceName, java.util.Properties prop)
          Returns a query to create a sequence entry.
 java.lang.String dropSequenceQuery(java.lang.String sequenceName)
          Override this method to enable database based sequence generation
 java.lang.String getEscapeClause(LikeCriteria aCriteria)
          Answer the Clause used Escape wildcards in LIKE
 java.lang.String nextSequenceQuery(java.lang.String sequenceName)
          Override this method to enable database based sequence generation
 void setObjectForStatement(java.sql.PreparedStatement ps, int index, java.lang.Object value, int sqlType)
          Called to let the Platform implementation perform any JDBC type-specific operations needed by the driver when binding positional parameters for a PreparedStatement.
 boolean supportsPaging()
          Answer true if LIMIT or equivalent is supported SQL-Paging is not yet supported
 
Methods inherited from class org.apache.ojb.broker.platforms.PlatformDefaultImpl
addBatch, afterStatementClose, afterStatementCreate, beforeBatch, beforeStatementClose, bindPagingParametersFirst, changeAutoCommitState, concatenate, executeBatch, getJoinSyntaxType, getLastInsertIdentityQuery, initializeJdbcConnection, prepareNextValProcedureStatement, registerOutResultSet, setNullForStatement, supportsBatchOperations, supportsMultiColumnCountDistinct, useCountForResultsetSize
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlatformPostgreSQLImpl

public PlatformPostgreSQLImpl()
Method Detail

setObjectForStatement

public void setObjectForStatement(java.sql.PreparedStatement ps,
                                  int index,
                                  java.lang.Object value,
                                  int sqlType)
                           throws java.sql.SQLException
Description copied from interface: Platform
Called to let the Platform implementation perform any JDBC type-specific operations needed by the driver when binding positional parameters for a PreparedStatement.

Specified by:
setObjectForStatement in interface Platform
Overrides:
setObjectForStatement in class PlatformDefaultImpl
Throws:
java.sql.SQLException

createSequenceQuery

public java.lang.String createSequenceQuery(java.lang.String sequenceName)
Description copied from class: PlatformDefaultImpl
Override this method to enable database based sequence generation

Specified by:
createSequenceQuery in interface Platform
Overrides:
createSequenceQuery in class PlatformDefaultImpl
Parameters:
sequenceName - The name of the sequence to create.
Returns:
a sql string to create a sequence

createSequenceQuery

public java.lang.String createSequenceQuery(java.lang.String sequenceName,
                                            java.util.Properties prop)
Description copied from interface: Platform
Returns a query to create a sequence entry.

Specified by:
createSequenceQuery in interface Platform
Overrides:
createSequenceQuery in class PlatformDefaultImpl
Parameters:
sequenceName - The name of the sequence to create.
prop - The database specific sequence properties.
Returns:
a sql string to create a sequence

nextSequenceQuery

public java.lang.String nextSequenceQuery(java.lang.String sequenceName)
Description copied from class: PlatformDefaultImpl
Override this method to enable database based sequence generation

Specified by:
nextSequenceQuery in interface Platform
Overrides:
nextSequenceQuery in class PlatformDefaultImpl
Returns:
a sql string to get next sequence value

dropSequenceQuery

public java.lang.String dropSequenceQuery(java.lang.String sequenceName)
Description copied from class: PlatformDefaultImpl
Override this method to enable database based sequence generation

Specified by:
dropSequenceQuery in interface Platform
Overrides:
dropSequenceQuery in class PlatformDefaultImpl
Returns:
a sql string to drop a sequence

addPagingSql

public void addPagingSql(java.lang.StringBuffer anSqlString)
Description copied from interface: Platform
Add the LIMIT or equivalent to the SQL SQL-Paging is not yet supported

Specified by:
addPagingSql in interface Platform
Overrides:
addPagingSql in class PlatformDefaultImpl
See Also:
Platform.addPagingSql(java.lang.StringBuffer)

supportsPaging

public boolean supportsPaging()
Description copied from interface: Platform
Answer true if LIMIT or equivalent is supported SQL-Paging is not yet supported

Specified by:
supportsPaging in interface Platform
Overrides:
supportsPaging in class PlatformDefaultImpl
See Also:
Platform.supportsPaging()

bindPagingParameters

public int bindPagingParameters(java.sql.PreparedStatement ps,
                                int index,
                                int startAt,
                                int endAt)
                         throws java.sql.SQLException
Description copied from interface: Platform
Bind the Paging Parameters SQL-Paging is not yet supported

Specified by:
bindPagingParameters in interface Platform
Overrides:
bindPagingParameters in class PlatformDefaultImpl
index - parameter index
Throws:
java.sql.SQLException
See Also:
Platform.bindPagingParameters(java.sql.PreparedStatement, int, int, int)

getEscapeClause

public java.lang.String getEscapeClause(LikeCriteria aCriteria)
Description copied from interface: Platform
Answer the Clause used Escape wildcards in LIKE

Specified by:
getEscapeClause in interface Platform
Overrides:
getEscapeClause in class PlatformDefaultImpl
See Also:
Platform.getEscapeClause(org.apache.ojb.broker.query.LikeCriteria)


(C) 2002 - 2006 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30