Package org.apache.cayenne.dba.h2
Class H2Adapter
java.lang.Object
org.apache.cayenne.dba.JdbcAdapter
org.apache.cayenne.dba.h2.H2Adapter
- All Implemented Interfaces:
DbAdapter
DbAdapter implementation for H2
RDBMS . Sample connection settings to use with H2 are shown
below:
postgres.jdbc.username = sa postgres.jdbc.password = postgres.jdbc.url = jdbc:h2:cayenne postgres.jdbc.driver = org.h2.Driver
- Since:
- 3.0
-
Field Summary
Fields inherited from class org.apache.cayenne.dba.JdbcAdapter
batchQueryBuilderFactory, caseInsensitiveCollations, ejbqlTranslatorFactory, extendedTypes, logger, quotingStrategy, resourceLocator, supportsBatchUpdates, supportsGeneratedKeys, supportsUniqueConstraints, typesHandler
-
Constructor Summary
ConstructorDescriptionH2Adapter
(RuntimeProperties runtimeProperties, List<ExtendedType> defaultExtendedTypes, List<ExtendedType> userExtendedTypes, List<ExtendedTypeFactory> extendedTypeFactories, ResourceLocator resourceLocator, ValueObjectTypeRegistry valueObjectTypeRegistry) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Installs appropriate ExtendedTypes as converters for passing values between JDBC and Java layers.protected PkGenerator
Creates and returns a primary key generator.void
createTableAppendColumn
(StringBuffer sqlBuffer, DbAttribute column) Appends SQL for column creation to CREATE TABLE buffer.Uses JdbcActionBuilder to create the right action.Methods inherited from class org.apache.cayenne.dba.JdbcAdapter
bindParameter, buildAttribute, createEJBQLTranslatorFactory, createFkConstraint, createQuotingStrategy, createTable, createTableAppendPKClause, createUniqueConstraint, dropTableStatements, externalTypesForJdbcType, findResource, getBatchTerminator, getEjbqlTranslatorFactory, getExtendedTypes, getJdbcEventLogger, getPkGenerator, getQuotingStrategy, getSelectTranslator, getSelectTranslator, getSystemCatalogs, getSystemSchemas, getType, initExtendedTypes, setEjbqlTranslatorFactory, setPkGenerator, setSupportsBatchUpdates, setSupportsGeneratedKeys, setSupportsUniqueConstraints, sizeAndPrecision, supportsBatchUpdates, supportsCatalogsOnReverseEngineering, supportsGeneratedKeys, supportsUniqueConstraints, tableTypeForTable, tableTypeForView, typeSupportsLength, unwrap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.cayenne.dba.DbAdapter
supportsGeneratedKeysForBatchInserts
-
Constructor Details
-
H2Adapter
public H2Adapter(RuntimeProperties runtimeProperties, List<ExtendedType> defaultExtendedTypes, List<ExtendedType> userExtendedTypes, List<ExtendedTypeFactory> extendedTypeFactories, ResourceLocator resourceLocator, ValueObjectTypeRegistry valueObjectTypeRegistry)
-
-
Method Details
-
createTableAppendColumn
Description copied from class:JdbcAdapter
Appends SQL for column creation to CREATE TABLE buffer.- Specified by:
createTableAppendColumn
in interfaceDbAdapter
- Overrides:
createTableAppendColumn
in classJdbcAdapter
- Parameters:
sqlBuffer
- theStringBuffer
to append the column type tocolumn
- theDbAttribute
defining the column to append type for
-
getSqlTreeProcessor
- Specified by:
getSqlTreeProcessor
in interfaceDbAdapter
- Overrides:
getSqlTreeProcessor
in classJdbcAdapter
- Returns:
SQLTreeProcessor
that can adjust SQL tree to specific database flavour- Since:
- 4.2
-
getAction
Description copied from class:JdbcAdapter
Uses JdbcActionBuilder to create the right action.- Specified by:
getAction
in interfaceDbAdapter
- Overrides:
getAction
in classJdbcAdapter
-
configureExtendedTypes
Installs appropriate ExtendedTypes as converters for passing values between JDBC and Java layers.- Overrides:
configureExtendedTypes
in classJdbcAdapter
- Since:
- 4.1.2
-
createPkGenerator
Description copied from class:JdbcAdapter
Creates and returns a primary key generator. This factory method should be overriden by JdbcAdapter subclasses to provide custom implementations of PKGenerator.- Overrides:
createPkGenerator
in classJdbcAdapter
-