public class PostgresAdapter extends JdbcAdapter
postgres.jdbc.username = test postgres.jdbc.password = secret postgres.jdbc.url = jdbc:postgresql://serverhostname/cayenne postgres.jdbc.driver = org.postgresql.Driver
Modifier and Type | Field and Description |
---|---|
static String |
BYTEA |
batchQueryBuilderFactory, caseInsensitiveCollations, ejbqlTranslatorFactory, extendedTypes, logger, quotingStrategy, resourceLocator, supportsBatchUpdates, supportsGeneratedKeys, supportsUniqueConstraints, typesHandler
Constructor and Description |
---|
PostgresAdapter(RuntimeProperties runtimeProperties,
List<ExtendedType> defaultExtendedTypes,
List<ExtendedType> userExtendedTypes,
List<ExtendedTypeFactory> extendedTypeFactories,
ResourceLocator resourceLocator,
ValueObjectTypeRegistry valueObjectTypeRegistry) |
Modifier and Type | Method and Description |
---|---|
void |
bindParameter(PreparedStatement statement,
ParameterBinding binding)
Binds an object value to PreparedStatement's parameter.
|
DbAttribute |
buildAttribute(String name,
String typeName,
int type,
int size,
int scale,
boolean allowNulls)
Creates and returns a DbAttribute based on supplied parameters (usually
obtained from database meta data).
|
protected void |
configureExtendedTypes(ExtendedTypeMap map)
Installs appropriate ExtendedTypes as converters for passing values
between JDBC and Java layers.
|
protected PkGenerator |
createPkGenerator()
Creates and returns a primary key generator.
|
String |
createTable(DbEntity ent)
Customizes table creating procedure for PostgreSQL.
|
Collection<String> |
dropTableStatements(DbEntity table)
Adds the CASCADE option to the DROP TABLE clause.
|
SQLAction |
getAction(Query query,
DataNode node)
Uses PostgresActionBuilder to create the right action.
|
SQLTreeProcessor |
getSqlTreeProcessor() |
List<String> |
getSystemSchemas() |
boolean |
supportsCatalogsOnReverseEngineering()
Returns true.
|
boolean |
typeSupportsLength(int type)
Returns true if supplied type can have a length attribute as a part of
column definition
|
createEJBQLTranslatorFactory, createFkConstraint, createQuotingStrategy, createTableAppendColumn, createTableAppendPKClause, createUniqueConstraint, externalTypesForJdbcType, findResource, getBatchTerminator, getEjbqlTranslatorFactory, getExtendedTypes, getJdbcEventLogger, getPkGenerator, getQuotingStrategy, getSelectTranslator, getSelectTranslator, getSystemCatalogs, getType, initExtendedTypes, setEjbqlTranslatorFactory, setPkGenerator, setSupportsBatchUpdates, setSupportsGeneratedKeys, setSupportsUniqueConstraints, sizeAndPrecision, supportsBatchUpdates, supportsGeneratedKeys, supportsUniqueConstraints, tableTypeForTable, tableTypeForView, unwrap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
supportsGeneratedKeysForBatchInserts
public static final String BYTEA
public PostgresAdapter(RuntimeProperties runtimeProperties, List<ExtendedType> defaultExtendedTypes, List<ExtendedType> userExtendedTypes, List<ExtendedTypeFactory> extendedTypeFactories, ResourceLocator resourceLocator, ValueObjectTypeRegistry valueObjectTypeRegistry)
public SQLTreeProcessor getSqlTreeProcessor()
getSqlTreeProcessor
in interface DbAdapter
getSqlTreeProcessor
in class JdbcAdapter
SQLTreeProcessor
that can adjust SQL tree to specific database flavourpublic SQLAction getAction(Query query, DataNode node)
getAction
in interface DbAdapter
getAction
in class JdbcAdapter
protected void configureExtendedTypes(ExtendedTypeMap map)
configureExtendedTypes
in class JdbcAdapter
public DbAttribute buildAttribute(String name, String typeName, int type, int size, int scale, boolean allowNulls)
DbAdapter
buildAttribute
in interface DbAdapter
buildAttribute
in class JdbcAdapter
name
- database column nametypeName
- database specific type name, may be used as a hint to
determine the right JDBC type.type
- JDBC column typesize
- database column size (ignored if less than zero)scale
- database column scale, i.e. the number of decimal digits
(ignored if less than zero)allowNulls
- database column nullable parameterpublic void bindParameter(PreparedStatement statement, ParameterBinding binding) throws SQLException, Exception
DbAdapter
bindParameter
in interface DbAdapter
bindParameter
in class JdbcAdapter
SQLException
Exception
public String createTable(DbEntity ent)
createTable
in interface DbAdapter
createTable
in class JdbcAdapter
public boolean typeSupportsLength(int type)
JdbcAdapter
typeSupportsLength
in interface DbAdapter
typeSupportsLength
in class JdbcAdapter
public Collection<String> dropTableStatements(DbEntity table)
dropTableStatements
in interface DbAdapter
dropTableStatements
in class JdbcAdapter
protected PkGenerator createPkGenerator()
JdbcAdapter
createPkGenerator
in class JdbcAdapter
JdbcAdapter.createPkGenerator()
public boolean supportsCatalogsOnReverseEngineering()
JdbcAdapter
supportsCatalogsOnReverseEngineering
in interface DbAdapter
supportsCatalogsOnReverseEngineering
in class JdbcAdapter
public List<String> getSystemSchemas()
getSystemSchemas
in interface DbAdapter
getSystemSchemas
in class JdbcAdapter
Copyright © 2001–2021 Apache Cayenne. All rights reserved.