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 SummaryFields inherited from class org.apache.cayenne.dba.JdbcAdaptercaseInsensitiveCollations, ejbqlTranslatorFactory, extendedTypes, logger, quotingStrategy, resourceLocator, supportsBatchUpdates, supportsGeneratedKeys, supportsUniqueConstraints, typesHandler
- 
Constructor SummaryConstructorsConstructorDescriptionH2Adapter(RuntimeProperties runtimeProperties, List<ExtendedType> defaultExtendedTypes, List<ExtendedType> userExtendedTypes, List<ExtendedTypeFactory> extendedTypeFactories, ResourceLocator resourceLocator, ValueObjectTypeRegistry valueObjectTypeRegistry) 
- 
Method SummaryModifier and TypeMethodDescriptionbuildAttribute(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 voidInstalls appropriate ExtendedTypes as converters for passing values between JDBC and Java layers.protected EJBQLTranslatorFactoryCreates and returns anEJBQLTranslatorFactoryused to generate visitors for EJBQL to SQL translations.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 org.apache.cayenne.dba.JdbcAdapterbindParameter, createFkConstraint, createQuotingStrategy, createTable, createTableAppendPKClause, createUniqueConstraint, dropTableStatements, externalTypesForJdbcType, findResource, getBatchTerminator, getEjbqlTranslatorFactory, getExtendedTypes, getJdbcEventLogger, getPkGenerator, getQuotingStrategy, getSelectTranslator, getSystemCatalogs, getSystemSchemas, getType, initExtendedTypes, setEjbqlTranslatorFactory, setPkGenerator, setSupportsBatchUpdates, setSupportsGeneratedKeys, setSupportsUniqueConstraints, sizeAndPrecision, supportsBatchUpdates, supportsCatalogsOnReverseEngineering, supportsGeneratedKeys, supportsUniqueConstraints, tableTypeForTable, tableTypeForView, typeSupportsLength, typeSupportsScale, unwrapMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.cayenne.dba.DbAdaptersupportsGeneratedKeysForBatchInserts
- 
Constructor Details- 
H2Adapterpublic H2Adapter(RuntimeProperties runtimeProperties, List<ExtendedType> defaultExtendedTypes, List<ExtendedType> userExtendedTypes, List<ExtendedTypeFactory> extendedTypeFactories, ResourceLocator resourceLocator, ValueObjectTypeRegistry valueObjectTypeRegistry) 
 
- 
- 
Method Details- 
createTableAppendColumnDescription copied from class:JdbcAdapterAppends SQL for column creation to CREATE TABLE buffer.- Specified by:
- createTableAppendColumnin interface- DbAdapter
- Overrides:
- createTableAppendColumnin class- JdbcAdapter
- Parameters:
- sqlBuffer- the- StringBufferto append the column type to
- column- the- DbAttributedefining the column to append type for
 
- 
getSqlTreeProcessor- Specified by:
- getSqlTreeProcessorin interface- DbAdapter
- Overrides:
- getSqlTreeProcessorin class- JdbcAdapter
- Returns:
- SQLTreeProcessorthat can adjust SQL tree to specific database flavour
- Since:
- 4.2
 
- 
createEJBQLTranslatorFactoryDescription copied from class:JdbcAdapterCreates and returns anEJBQLTranslatorFactoryused to generate visitors for EJBQL to SQL translations. This method should be overriden by subclasses that need to customize EJBQL generation.- Overrides:
- createEJBQLTranslatorFactoryin class- JdbcAdapter
- Returns:
- translator factory for EJBQL queries
- Since:
- 5.0
 
- 
getActionDescription copied from class:JdbcAdapterUses JdbcActionBuilder to create the right action.- Specified by:
- getActionin interface- DbAdapter
- Overrides:
- getActionin class- JdbcAdapter
 
- 
configureExtendedTypesInstalls appropriate ExtendedTypes as converters for passing values between JDBC and Java layers.- Overrides:
- configureExtendedTypesin class- JdbcAdapter
- Since:
- 4.1.2
 
- 
buildAttributepublic DbAttribute buildAttribute(String name, String typeName, int type, int size, int scale, boolean allowNulls) Description copied from interface:DbAdapterCreates and returns a DbAttribute based on supplied parameters (usually obtained from database meta data).- Specified by:
- buildAttributein interface- DbAdapter
- Overrides:
- buildAttributein class- JdbcAdapter
- Parameters:
- name- database column name
- typeName- database specific type name, may be used as a hint to determine the right JDBC type.
- type- JDBC column type
- size- 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
 
 
-