Class H2Adapter
java.lang.Object
org.apache.cayenne.dba.JdbcAdapter
org.apache.cayenne.dba.h2.H2Adapter
- All Implemented Interfaces:
DbAdapter
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionH2Adapter(RuntimeProperties runtimeProperties, List<ExtendedType> defaultExtendedTypes, List<ExtendedType> userExtendedTypes, List<ExtendedTypeFactory> extendedTypeFactories, ValueObjectTypeRegistry valueObjectTypeRegistry) -
Method Summary
Modifier and TypeMethodDescriptionbuildAttribute(String name, String typeName, int type, int maxLength, int scale, boolean allowNulls) Creates and returns a DbAttribute based on supplied parameters (usually obtained from database metadata).protected voidInstalls appropriate ExtendedTypes as converters for passing values between JDBC and Java layers.protected EJBQLTranslatorCreates and returns anEJBQLTranslatorused to generate visitors for EJBQL to SQL translations.protected NativeColumnType[]Returns the database-native types supported by this adapter.Returns aH2PkGenerator.voidcreateTableAppendColumn(StringBuffer sqlBuffer, DbAttribute column) Appends SQL for column creation to CREATE TABLE buffer.Uses JdbcActionBuilder to create the right action.Methods inherited from class JdbcAdapter
bind, bindParameter, bindParameter, createFkConstraint, createQuotingStrategy, createTable, createTableAppendPKClause, createUniqueConstraint, defaultCharColumnLength, dropTableStatements, externalTypesForJdbcType, getBatchTerminator, getEjbqlTranslator, getExtendedTypes, getProcedureTranslator, getQuotingStrategy, getQuotingStrategy, getSelectTranslator, getSQLLogger, getSystemCatalogs, getSystemSchemas, getType, initExtendedTypes, nativeColumnTypes, setEjbqlTranslator, setEjbqlTranslatorFactory, setSupportsBatchUpdates, setSupportsGeneratedKeys, setSupportsUniqueConstraints, sizeAndPrecision, sizeAndScale, supportsBatchUpdates, supportsCatalogsOnReverseEngineering, supportsGeneratedKeys, supportsUniqueConstraints, tableTypeForTable, tableTypeForView, typeSupportsLength, typeSupportsScale, unwrapMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DbAdapter
getEjbqlTranslatorFactory, preferredBindingType, preferredNativeColumnType, supportsGeneratedKeysForBatchInserts
-
Constructor Details
-
H2Adapter
public H2Adapter(RuntimeProperties runtimeProperties, List<ExtendedType> defaultExtendedTypes, List<ExtendedType> userExtendedTypes, List<ExtendedTypeFactory> extendedTypeFactories, ValueObjectTypeRegistry valueObjectTypeRegistry)
-
-
Method Details
-
createNativeTypes
Description copied from class:JdbcAdapterReturns the database-native types supported by this adapter.- Overrides:
createNativeTypesin classJdbcAdapter
-
createTableAppendColumn
Description copied from class:JdbcAdapterAppends SQL for column creation to CREATE TABLE buffer.- Specified by:
createTableAppendColumnin interfaceDbAdapter- Overrides:
createTableAppendColumnin classJdbcAdapter- Parameters:
sqlBuffer- theStringBufferto append the column type tocolumn- theDbAttributedefining the column to append type for
-
createPkGenerator
Returns aH2PkGenerator.- Specified by:
createPkGeneratorin interfaceDbAdapter- Overrides:
createPkGeneratorin classJdbcAdapter
-
getSqlTreeProcessor
- Specified by:
getSqlTreeProcessorin interfaceDbAdapter- Overrides:
getSqlTreeProcessorin classJdbcAdapter- Returns:
SQLTreeProcessorthat can adjust SQL tree to specific database flavour- Since:
- 4.2
-
createEJBQLTranslator
Description copied from class:JdbcAdapterCreates and returns anEJBQLTranslatorused to generate visitors for EJBQL to SQL translations. This method should be overriden by subclasses that need to customize EJBQL generation.- Overrides:
createEJBQLTranslatorin classJdbcAdapter- Returns:
- translator factory for EJBQL queries
- Since:
- 5.0
-
getAction
Description copied from class:JdbcAdapterUses JdbcActionBuilder to create the right action.- Specified by:
getActionin interfaceDbAdapter- Overrides:
getActionin classJdbcAdapter
-
configureExtendedTypes
Installs appropriate ExtendedTypes as converters for passing values between JDBC and Java layers.- Overrides:
configureExtendedTypesin classJdbcAdapter- Since:
- 4.1.2
-
buildAttribute
public DbAttribute buildAttribute(String name, String typeName, int type, int maxLength, int scale, boolean allowNulls) Description copied from interface:DbAdapterCreates and returns a DbAttribute based on supplied parameters (usually obtained from database metadata).- Specified by:
buildAttributein interfaceDbAdapter- Overrides:
buildAttributein classJdbcAdapter- Parameters:
name- database column nametypeName- database specific type name, may be used as a hint to determine the right JDBC type.type- JDBC column typemaxLength- 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 parameter
-