public class PostgreSqlAdaptor extends JdbcAdaptor
JdbcAdaptor.PaginationParamsOrder| Constructor and Description |
|---|
PostgreSqlAdaptor() |
| Modifier and Type | Method and Description |
|---|---|
String |
applyConcat(List<String> arguments)
Applies the concat operation to the arguments.
|
String |
applyLikeEscape(String escapePattern)
Appends the escape pattern.
|
String |
applyLock(String sql,
javax.persistence.LockModeType lockMode)
Applies the lock to SQL string.
|
String |
applyPagination(String sql,
int startPosition,
int maxResult)
Applies the pagination to SQL string.
|
String |
createColumnDDL(AbstractColumn column)
Creates(generates) the BasicColumn Definition DDL for the column.
|
void |
createSequenceIfNecessary(DataSource datasource,
SequenceGenerator sequence)
Creates the sequence if not exists.
|
protected void |
dropTable(QueryRunner runner,
AbstractTable table)
Drops the table
|
protected String |
getColumnType(AbstractColumn cd,
int sqlType)
Returns the data type of the column.
|
protected String |
getDatabaseName()
Returns the name of the database.
|
protected String |
getDropForeignKeySql(String schema,
String table,
String foreignKey)
Returns the SQL to drop the foreign key.
|
long |
getNextSequence(DataSource datasource,
String sequenceName)
Returns next sequence number from the database.
|
JdbcAdaptor.PaginationParamsOrder |
getPaginationParamsOrder()
Returns the pagination params order for the adaptor.
|
protected String[] |
getProductNames() |
String |
getSelectLastIdentitySql(BasicColumn identityColumn)
Returns the SQL to select the last identity generated.
|
protected boolean |
isForeignKeyHasDefaultIndex()
Underlining DB creates an index for foreign Keys
|
boolean |
paginationNeedsMaxResultsAlways()
Returns if pagination always needs the max results paramater.
|
boolean |
paginationNeedsStartAlways()
Returns if pagination always needs the start paramater.
|
boolean |
parameterizedPagination()
Returns if the paginated sql uses parameters instead of hard coded pagination variables.
|
IdType |
supports(javax.persistence.GenerationType type)
Returns the id type supported.
|
createCreateTableStatement, createForeignKey, createIndex, createOrUpdateTable, createTableGeneratorIfNecessary, dropAllForeignKeys, dropAllSequences, dropAllTables, dropSequence, escape, getColumns, getCurrentDate, getCurrentTime, getCurrentTimeStamp, getDateTimeFunctionTemplate, getInsertBatchSize, getNumericFunctionTemplate, getPkCreateSql, getPkDropSql, getRemoveBatchSize, importSql, isPmdBroken, isTableRequiredPrimaryKey, logRelaxed, modifiesParameters, modifyParameters, qualified, setInsertBatchSize, setRemoveBatchSize, supportsNamedParams, supportsOrdinalParamsapplyCast, applySubStr, applyTrim, castBoolean, getAdapter, getCastClassNamepublic String applyConcat(List<String> arguments)
applyConcat in class AbstractJdbcAdaptorarguments - the argumentspublic String applyLikeEscape(String escapePattern)
applyLikeEscape in class AbstractJdbcAdaptorescapePattern - the escape patternpublic String applyLock(String sql, javax.persistence.LockModeType lockMode)
applyLock in class AbstractJdbcAdaptorsql - the SQL to applylockMode - the lock modepublic String applyPagination(String sql, int startPosition, int maxResult)
applyPagination in class AbstractJdbcAdaptorsql - the SQL to applystartPosition - the start positionmaxResult - the max number of resultspublic String createColumnDDL(AbstractColumn column)
createColumnDDL in class JdbcAdaptorcolumn - the column definition to create the DDL frompublic void createSequenceIfNecessary(DataSource datasource, SequenceGenerator sequence)
createSequenceIfNecessary in class JdbcAdaptordatasource - the datasource to usesequence - the sequence to createprotected void dropTable(QueryRunner runner, AbstractTable table) throws SQLException
dropTable in class JdbcAdaptorrunner - the runnertable - the tableSQLExceptionprotected String getColumnType(AbstractColumn cd, int sqlType)
getColumnType in class JdbcAdaptorcd - the column definitionsqlType - the sql typeprotected String getDatabaseName()
getDatabaseName in class JdbcAdaptorprotected String getDropForeignKeySql(String schema, String table, String foreignKey)
getDropForeignKeySql in class JdbcAdaptorschema - the name of the schematable - the name of the tableforeignKey - the name of the foreign keypublic long getNextSequence(DataSource datasource, String sequenceName) throws SQLException
getNextSequence in class JdbcAdaptordatasource - the datasource to usesequenceName - the name of the sequenceSQLException - thrown in case of an SQL errorpublic JdbcAdaptor.PaginationParamsOrder getPaginationParamsOrder()
getPaginationParamsOrder in class JdbcAdaptorprotected String[] getProductNames()
getProductNames in class AbstractJdbcAdaptorpublic String getSelectLastIdentitySql(BasicColumn identityColumn)
getSelectLastIdentitySql in class JdbcAdaptoridentityColumn - the identity columnprotected boolean isForeignKeyHasDefaultIndex()
isForeignKeyHasDefaultIndex in class JdbcAdaptorpublic boolean paginationNeedsMaxResultsAlways()
paginationNeedsMaxResultsAlways in class JdbcAdaptorpublic boolean paginationNeedsStartAlways()
paginationNeedsStartAlways in class JdbcAdaptorpublic boolean parameterizedPagination()
parameterizedPagination in class JdbcAdaptorpublic IdType supports(javax.persistence.GenerationType type)
If the idType is null, the adapter should suggest an IdType in return.
If the idType is some other value than null then the adapter should either return the same IdType if supported or null value
in case the adapter does not support the specified IdType.
supports in class JdbcAdaptortype - the id typeIdType selected, the Id passed or nullCopyright © 2012-2013 Batoo. All Rights Reserved.