Package org.eclipse.net4j.db.postgresql
Class PostgreSQLAdapter
java.lang.Object
org.eclipse.net4j.spi.db.DBAdapter
org.eclipse.net4j.db.postgresql.PostgreSQLAdapter
- All Implemented Interfaces:
IDBAdapter,IDBAdapterID
A
DB adapter for PostgreSQL databases.- Author:
- Victor Roldan Betancort
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.net4j.spi.db.DBAdapter
DBAdapter.FieldInfo, DBAdapter.IndexInfoNested classes/interfaces inherited from interface org.eclipse.net4j.db.IDBAdapter
IDBAdapter.Registry -
Field Summary
FieldsFields inherited from interface org.eclipse.net4j.db.IDBAdapter
REGISTRY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoCreateTable(IDBTable table, Statement statement) protected voidforEachTable(Connection connection, String schemaName, boolean caseSensitive, org.eclipse.net4j.util.ConsumerWithException<String, SQLException> tableNameConsumer) Enumerates the tables that belong to a schema while reading a database schema.getDefaultSchemaName(Connection connection) intgetJDBCTypeForNull(DBType type) Returns the JDBC type to use when binding a null value for the given database type.intintString[]protected StringgetTypeName(IDBField field) booleanbooleanSee Appendix A.booleanSee Appendix A.booleanPostgreSQL marks the current transaction as aborted after a duplicate-key violation.booleanSee Appendix A.protected voidreadIndices(Connection connection, DatabaseMetaData metaData, IDBTable table, String schemaName) sqlCharIndex(Object substring, Object string) Methods inherited from class org.eclipse.net4j.spi.db.DBAdapter
adaptType, addIndex, addIndexField, alterTable, appendFieldDefs, appendFieldNames, convertString, convertString, convertString, convertToSQL, createConnectionProvider, createConstraints, createField, createField, createFieldDefinition, createFieldDefinitions, createIndex, createIndex, createIndex, createIndexFields, createJDBCDataSource, createPrimaryKey, createSchema, createTable, createTable, createTables, dropField, dropField, dropIndex, dropIndex, dropPrimaryKey, dropTable, dropTable, dropTables, equals, format, format, generateReservedWords, getDefaultDBLength, getDropTableSQL, getFieldLength, getIndexInfos, getJDBCDriver, getName, getNullableConstraint, getSQL92ReservedWords, getVersion, hashCode, isPrimaryKeyShadow, isReservedWord, isTypeIndexable, isValidFirstChar, modifyConnection, openSchemaTransaction, readFields, readIndices, readSchema, readSchema, readTables, sqlCharIndexFunction, sqlConcat, sqlModifyField, sqlModifyField, sqlRenameField, sqlSubstring, sqlSubstring, sqlSubstringFunction, toString, updateSchema, validateTable
-
Field Details
-
NAME
- See Also:
-
VERSION
- See Also:
-
-
Constructor Details
-
PostgreSQLAdapter
public PostgreSQLAdapter() -
PostgreSQLAdapter
- Since:
- 4.4
-
-
Method Details
-
isCaseSensitive
public boolean isCaseSensitive()- Specified by:
isCaseSensitivein interfaceIDBAdapter- Overrides:
isCaseSensitivein classDBAdapter
-
forEachTable
protected void forEachTable(Connection connection, String schemaName, boolean caseSensitive, org.eclipse.net4j.util.ConsumerWithException<String, SQLException> tableNameConsumer) Description copied from class:DBAdapterEnumerates the tables that belong to a schema while reading a database schema.- Overrides:
forEachTablein classDBAdapter
-
readIndices
protected void readIndices(Connection connection, DatabaseMetaData metaData, IDBTable table, String schemaName) throws SQLException - Overrides:
readIndicesin classDBAdapter- Throws:
SQLException
-
getDefaultSchemaName
- Specified by:
getDefaultSchemaNamein interfaceIDBAdapter- Overrides:
getDefaultSchemaNamein classDBAdapter
-
getMaxTableNameLength
public int getMaxTableNameLength()- Specified by:
getMaxTableNameLengthin interfaceIDBAdapter- Overrides:
getMaxTableNameLengthin classDBAdapter- Since:
- 2.0
-
getMaxFieldNameLength
public int getMaxFieldNameLength()- Specified by:
getMaxFieldNameLengthin interfaceIDBAdapter- Overrides:
getMaxFieldNameLengthin classDBAdapter- Since:
- 2.0
-
getJDBCTypeForNull
Description copied from interface:IDBAdapterReturns the JDBC type to use when binding a null value for the given database type.- Specified by:
getJDBCTypeForNullin interfaceIDBAdapter- Overrides:
getJDBCTypeForNullin classDBAdapter
-
getTypeName
- Overrides:
getTypeNamein classDBAdapter
-
getReservedWords
-
isDuplicateKeyTransactionAbort
public boolean isDuplicateKeyTransactionAbort()PostgreSQL marks the current transaction as aborted after a duplicate-key violation. A savepoint is therefore required when the violation is an expected outcome.- Specified by:
isDuplicateKeyTransactionAbortin interfaceIDBAdapter- Overrides:
isDuplicateKeyTransactionAbortin classDBAdapter
-
isDuplicateKeyException
- Specified by:
isDuplicateKeyExceptionin interfaceIDBAdapter- Overrides:
isDuplicateKeyExceptionin classDBAdapter
-
isTableNotFoundException
- Specified by:
isTableNotFoundExceptionin interfaceIDBAdapter- Overrides:
isTableNotFoundExceptionin classDBAdapter
-
isColumnNotFoundException
- Specified by:
isColumnNotFoundExceptionin interfaceIDBAdapter- Overrides:
isColumnNotFoundExceptionin classDBAdapter
-
doCreateTable
- Overrides:
doCreateTablein classDBAdapter- Throws:
SQLException- Since:
- 4.1
-
sqlCharIndex
- Specified by:
sqlCharIndexin interfaceIDBAdapter- Overrides:
sqlCharIndexin classDBAdapter
-