|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.dba.JdbcAdapter
org.apache.cayenne.dba.postgres.PostgresAdapter
public class PostgresAdapter
DbAdapter implementation for PostgreSQL RDBMS . Sample connection settings to use with PostgreSQL are shown below:
postgres.jdbc.username = test postgres.jdbc.password = secret postgres.jdbc.url = jdbc:postgresql://serverhostname/cayenne postgres.jdbc.driver = org.postgresql.Driver
Field Summary |
---|
Fields inherited from class org.apache.cayenne.dba.JdbcAdapter |
---|
batchQueryBuilderFactory, caseInsensitiveCollations, CI_PROPERTY, ejbqlTranslatorFactory, extendedTypes, identifiersEndQuote, identifiersStartQuote, logger, resourceLocator, supportsBatchUpdates, supportsGeneratedKeys, supportsUniqueConstraints, typesHandler |
Constructor Summary | |
---|---|
PostgresAdapter(RuntimeProperties runtimeProperties,
java.util.List<ExtendedType> defaultExtendedTypes,
java.util.List<ExtendedType> userExtendedTypes,
java.util.List<ExtendedTypeFactory> extendedTypeFactories)
|
Method Summary | |
---|---|
DbAttribute |
buildAttribute(java.lang.String name,
java.lang.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. |
java.lang.String |
createTable(DbEntity ent)
Customizes table creating procedure for PostgreSQL. |
java.util.Collection<java.lang.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. |
QualifierTranslator |
getQualifierTranslator(QueryAssembler queryAssembler)
Returns a trimming translator. |
MergerFactory |
mergerFactory()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PostgresAdapter(RuntimeProperties runtimeProperties, java.util.List<ExtendedType> defaultExtendedTypes, java.util.List<ExtendedType> userExtendedTypes, java.util.List<ExtendedTypeFactory> extendedTypeFactories)
Method Detail |
---|
public 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(java.lang.String name, java.lang.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 java.lang.String createTable(DbEntity ent)
createTable
in interface DbAdapter
createTable
in class JdbcAdapter
public java.util.Collection<java.lang.String> dropTableStatements(DbEntity table)
dropTableStatements
in interface DbAdapter
dropTableStatements
in class JdbcAdapter
public QualifierTranslator getQualifierTranslator(QueryAssembler queryAssembler)
getQualifierTranslator
in interface DbAdapter
getQualifierTranslator
in class JdbcAdapter
protected PkGenerator createPkGenerator()
JdbcAdapter
createPkGenerator
in class JdbcAdapter
JdbcAdapter.createPkGenerator()
public MergerFactory mergerFactory()
mergerFactory
in interface DbAdapter
mergerFactory
in class JdbcAdapter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |