|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.store.rdbms.adapter.DatabaseAdapter
org.datanucleus.store.rdbms.adapter.PostgreSQLAdapter
public class PostgreSQLAdapter
Provides methods for adapting SQL language elements to the PostgreSQL database.
| Field Summary | |
|---|---|
static String |
POSTGRESQL_RESERVED_WORDS
List of Postgresql keywords that aren't in SQL92, SQL99 |
protected Hashtable |
psqlTypes
|
| Fields inherited from class org.datanucleus.store.rdbms.adapter.DatabaseAdapter |
|---|
catalogSeparator, datastoreMajorVersion, datastoreMinorVersion, datastoreProductName, datastoreProductVersion, datastoreRevisionVersion, driverMajorVersion, driverMinorVersion, driverName, driverVersion, identifierQuoteString, LOCALISER, LOCALISER_BASE, maxColumnNameLength, maxConstraintNameLength, maxIndexNameLength, maxTableNameLength, properties, reservedKeywords, supportedOptions |
| Fields inherited from interface org.datanucleus.store.mapped.DatastoreAdapter |
|---|
ANALYSIS_METHODS, BIT_IS_REALLY_BOOLEAN, BOOLEAN_COMPARISON, CATALOGS_IN_TABLE_DEFINITIONS, ESCAPE_EXPRESSION_IN_LIKE_PREDICATE, IDENTIFIERS_LOWERCASE, IDENTIFIERS_LOWERCASE_QUOTED, IDENTIFIERS_MIXEDCASE, IDENTIFIERS_MIXEDCASE_QUOTED, IDENTIFIERS_MIXEDCASE_QUOTED_SENSITIVE, IDENTIFIERS_MIXEDCASE_SENSITIVE, IDENTIFIERS_UPPERCASE, IDENTIFIERS_UPPERCASE_QUOTED, IDENTITY_COLUMNS, PROJECTION_IN_TABLE_REFERENCE_JOINS, SCHEMAS_IN_TABLE_DEFINITIONS, SEQUENCES |
| Constructor Summary | |
|---|---|
PostgreSQLAdapter(DatabaseMetaData metadata)
Constructor. |
|
| Method Summary | |
|---|---|
String |
getAddColumnStatement(org.datanucleus.store.mapped.DatastoreContainerObject table,
Column col)
Accessor for the SQL statement to add a column to a table. |
String |
getAddPrimaryKeyStatement(PrimaryKey pk,
org.datanucleus.store.mapped.IdentifierFactory factory)
PostgreSQL allows specification of PRIMARY KEY in the CREATE TABLE, so we need nothing here. |
String |
getAutoIncrementKeyword()
Accessor for the auto-increment keyword for generating DDLs (CREATE TABLEs...). |
String |
getAutoIncrementStmt(Table table,
String columnName)
Accessor for the autoincrement sql access statement for this datastore. |
String |
getCreateIndexStatement(Index idx,
org.datanucleus.store.mapped.IdentifierFactory factory)
Returns the appropriate DDL to create an index. |
String |
getDropTableStatement(org.datanucleus.store.mapped.DatastoreContainerObject table)
Accessor for the statement for dropping a table. |
String |
getEscapePatternExpression()
The character for escaping patterns. |
String |
getInsertStatementForNoColumns(Table table)
Method to return the INSERT statement to use when inserting into a table and we dont want to specify columns. |
String |
getRangeByLimitEndOfStatementClause(long offset,
long count)
Method to return the SQL to append to the WHERE clause of a SELECT statement to handle restriction of ranges using the LIMUT keyword. |
String |
getSequenceCreateStmt(String sequence_name,
Integer min,
Integer max,
Integer start,
Integer increment,
Integer cache_size)
Accessor for the sequence statement to create the sequence. |
String |
getSequenceNextStmt(String sequence_name)
Accessor for the statement for getting the next id from the sequence for this datastore. |
String |
getVendorID()
Accessor for the vendor id. |
void |
initialiseTypes(org.datanucleus.store.schema.StoreSchemaHandler handler,
org.datanucleus.store.connection.ManagedConnection mconn)
Initialise the types for this datastore. |
boolean |
isStatementCancel(SQLException sqle)
return whether this exception represents a cancelled statement. |
ForeignKeyInfo |
newFKInfo(ResultSet rs)
Method to return ForeignKeyInfo for the current row of the ResultSet which will have been obtained from a call to DatabaseMetaData.getImportedKeys() or DatabaseMetaData.getExportedKeys(). |
RDBMSColumnInfo |
newRDBMSColumnInfo(ResultSet rs)
Method to create a column info for the current row. |
SQLTypeInfo |
newSQLTypeInfo(ResultSet rs)
Create a new SQL type info from the current row of the passed ResultSet. |
boolean |
supportsQueryFetchSize(int size)
Whether the datastore will support setting the query fetch size to the supplied value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String POSTGRESQL_RESERVED_WORDS
protected Hashtable psqlTypes
| Constructor Detail |
|---|
public PostgreSQLAdapter(DatabaseMetaData metadata)
metadata - MetaData for the DB| Method Detail |
|---|
public void initialiseTypes(org.datanucleus.store.schema.StoreSchemaHandler handler,
org.datanucleus.store.connection.ManagedConnection mconn)
initialiseTypes in interface org.datanucleus.store.mapped.DatastoreAdapterinitialiseTypes in class DatabaseAdapterhandler - SchemaHandler that we initialise the types formconn - Managed connection to usepublic String getVendorID()
getVendorID in interface org.datanucleus.store.mapped.DatastoreAdaptergetVendorID in class DatabaseAdapterpublic SQLTypeInfo newSQLTypeInfo(ResultSet rs)
RDBMSAdapter
newSQLTypeInfo in interface RDBMSAdapternewSQLTypeInfo in class DatabaseAdapterrs - ResultSet
public RDBMSColumnInfo newRDBMSColumnInfo(ResultSet rs)
newRDBMSColumnInfo in interface RDBMSAdapternewRDBMSColumnInfo in class DatabaseAdapterrs - ResultSet from DatabaseMetaData.getColumns()
public ForeignKeyInfo newFKInfo(ResultSet rs)
newFKInfo in interface RDBMSAdapternewFKInfo in class DatabaseAdapterrs - The result set returned from DatabaseMetaData.get??portedKeys()
public String getAddColumnStatement(org.datanucleus.store.mapped.DatastoreContainerObject table,
Column col)
getAddColumnStatement in interface RDBMSAdaptergetAddColumnStatement in class DatabaseAdaptertable - The tablecol - The column
public String getInsertStatementForNoColumns(Table table)
INSERT INTO tbl VALUES(DEFAULT)
getInsertStatementForNoColumns in interface RDBMSAdaptergetInsertStatementForNoColumns in class DatabaseAdaptertable - The table
public String getAddPrimaryKeyStatement(PrimaryKey pk,
org.datanucleus.store.mapped.IdentifierFactory factory)
getAddPrimaryKeyStatement in interface RDBMSAdaptergetAddPrimaryKeyStatement in class DatabaseAdapterpk - An object describing the primary key.factory - Identifier factory
public String getDropTableStatement(org.datanucleus.store.mapped.DatastoreContainerObject table)
getDropTableStatement in interface RDBMSAdaptergetDropTableStatement in class DatabaseAdaptertable - The table to drop.
public String getCreateIndexStatement(Index idx,
org.datanucleus.store.mapped.IdentifierFactory factory)
getCreateIndexStatement in interface RDBMSAdaptergetCreateIndexStatement in class DatabaseAdapteridx - An object describing the index.factory - Identifier factory
public String getAutoIncrementStmt(Table table,
String columnName)
getAutoIncrementStmt in interface RDBMSAdaptergetAutoIncrementStmt in class DatabaseAdaptertable - Table that the autoincrement is forcolumnName - Name of the column that the autoincrement is for
public String getAutoIncrementKeyword()
getAutoIncrementKeyword in interface RDBMSAdaptergetAutoIncrementKeyword in class DatabaseAdapter
public String getSequenceCreateStmt(String sequence_name,
Integer min,
Integer max,
Integer start,
Integer increment,
Integer cache_size)
getSequenceCreateStmt in interface RDBMSAdaptergetSequenceCreateStmt in class DatabaseAdaptersequence_name - Name of the sequencemin - Minimum value for the sequencemax - Maximum value for the sequencestart - Start value for the sequenceincrement - Increment value for the sequencecache_size - Cache size for the sequence
public String getSequenceNextStmt(String sequence_name)
getSequenceNextStmt in interface RDBMSAdaptergetSequenceNextStmt in class DatabaseAdaptersequence_name - Name of the sequence
public boolean supportsQueryFetchSize(int size)
supportsQueryFetchSize in interface org.datanucleus.store.mapped.DatastoreAdaptersupportsQueryFetchSize in class DatabaseAdaptersize - The value to set to
public String getRangeByLimitEndOfStatementClause(long offset,
long count)
getRangeByLimitEndOfStatementClause in interface RDBMSAdaptergetRangeByLimitEndOfStatementClause in class DatabaseAdapteroffset - The offset to return fromcount - The number of items to return
public String getEscapePatternExpression()
getEscapePatternExpression in class DatabaseAdapterpublic boolean isStatementCancel(SQLException sqle)
isStatementCancel in interface RDBMSAdapterisStatementCancel in class DatabaseAdaptersqle - the exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||