Class IngresAdapter
java.lang.Object
org.apache.cayenne.dba.JdbcAdapter
org.apache.cayenne.dba.ingres.IngresAdapter
- All Implemented Interfaces:
DbAdapter
DbAdapter implementation for Ingres. Sample
connection settings to use with Ingres are shown below:
ingres.jdbc.username = test ingres.jdbc.password = secret ingres.jdbc.url = jdbc:ingres://serverhostname:II7/cayenne ingres.jdbc.driver = ca.ingres.jdbc.IngresDriver
-
Field Summary
FieldsFields inherited from class JdbcAdapter
caseInsensitiveCollations, ejbqlTranslatorFactory, extendedTypes, logger, quotingStrategy, resourceLocator, supportsBatchUpdates, supportsGeneratedKeys, supportsUniqueConstraints, typesHandlerModifier and TypeFieldDescriptionprotected booleanprotected EJBQLTranslatorFactoryprotected ExtendedTypeMapprotected JdbcEventLoggerprotected QuotingStrategyprotected ResourceLocatorprotected booleanprotected booleanprotected booleanprotected TypesHandler -
Constructor Summary
ConstructorsConstructorDescriptionIngresAdapter(RuntimeProperties runtimeProperties, List<ExtendedType> defaultExtendedTypes, List<ExtendedType> userExtendedTypes, List<ExtendedTypeFactory> extendedTypeFactories, ResourceLocator resourceLocator, ValueObjectTypeRegistry valueObjectTypeRegistry) -
Method Summary
Modifier and TypeMethodDescriptionvoidbindParameter(PreparedStatement statement, ParameterBinding binding) Binds an object value to PreparedStatement's parameter.protected voidCalled fromJdbcAdapter.initExtendedTypes(List, List, List, ValueObjectTypeRegistry)to load adapter-specific types into the ExtendedTypeMap right after the default types are loaded, but before the DI overrides are.voidAppends SQL for column creation to CREATE TABLE buffer.Uses JdbcActionBuilder to create the right action.Methods inherited from class JdbcAdapter
buildAttribute, createEJBQLTranslatorFactory, 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, unwrapModifier 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 EJBQLTranslatorFactoryCreates and returns anEJBQLTranslatorFactoryused to generate visitors for EJBQL to SQL translations.Returns a SQL string that can be used to create a foreign key constraint for the relationship.protected QuotingStrategycreateTable(DbEntity entity) Returns a SQL string that can be used to create database table corresponding toentparameter.protected voidcreateTableAppendPKClause(StringBuffer sqlBuffer, DbEntity entity) createUniqueConstraint(DbEntity source, Collection<DbAttribute> columns) Returns a DDL string to create a unique constraint over a set of columns.dropTableStatements(DbEntity table) Returns a collection of SQL statements needed to drop a database table.String[]externalTypesForJdbcType(int type) Returns an array of RDBMS types that can be used with JDBCtype.protected URLfindResource(String name) Locates and returns a named adapter resource.Returns default separator - a semicolon.Returns a translator factory for EJBQL to SQL translation.Returns a map of ExtendedTypes that is used to translate values between Java and JDBC layer.Returns primary key generator associated with this DbAdapter.Returns SQL identifier quoting strategy objectgetSelectTranslator(FluentSelect<?, ?> query, EntityResolver entityResolver) static StringgetType(DbAdapter adapter, DbAttribute column) protected voidinitExtendedTypes(List<ExtendedType> defaultExtendedTypes, List<ExtendedType> userExtendedTypes, List<ExtendedTypeFactory> extendedTypeFactories, ValueObjectTypeRegistry valueObjectTypeRegistry) voidsetEjbqlTranslatorFactory(EJBQLTranslatorFactory ejbqlTranslatorFactory) Sets a translator factory for EJBQL to SQL translation.voidsetPkGenerator(PkGenerator pkGenerator) Sets new primary key generator.voidsetSupportsBatchUpdates(boolean flag) voidsetSupportsGeneratedKeys(boolean flag) voidsetSupportsUniqueConstraints(boolean flag) static StringsizeAndPrecision(DbAdapter adapter, DbAttribute column) booleanReturnstrueif the target database supports batch updates.booleanReturns true.booleanReturns true if a target database supports key autogeneration.booleanReturns true.Returns the name of the table type (as returned byDatabaseMetaData.getTableTypes) for a simple user table.Returns the name of the table type (as returned byDatabaseMetaData.getTableTypes) for a view table.booleantypeSupportsLength(int type) Returns true if supplied type can have a length attribute as a part of column definitionbooleantypeSupportsScale(int type) Returns true if supplied type can have a scale attribute as a part of column definition.unwrap()Simply returns this, as JdbcAdapter is not a wrapper.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DbAdapter
supportsGeneratedKeysForBatchInsertsModifier and TypeMethodDescriptiondefault booleanReturns true if a target database supports key autogeneration in a batch insert.
-
Field Details
-
TRIM_FUNCTION
- See Also:
-
-
Constructor Details
-
IngresAdapter
public IngresAdapter(RuntimeProperties runtimeProperties, List<ExtendedType> defaultExtendedTypes, List<ExtendedType> userExtendedTypes, List<ExtendedTypeFactory> extendedTypeFactories, ResourceLocator resourceLocator, ValueObjectTypeRegistry valueObjectTypeRegistry)
-
-
Method Details
-
getSqlTreeProcessor
- Specified by:
getSqlTreeProcessorin interfaceDbAdapter- Overrides:
getSqlTreeProcessorin classJdbcAdapter- Returns:
SQLTreeProcessorthat can adjust SQL tree to specific database flavour- Since:
- 4.2
-
getAction
Description copied from class:JdbcAdapterUses JdbcActionBuilder to create the right action.- Specified by:
getActionin interfaceDbAdapter- Overrides:
getActionin classJdbcAdapter
-
configureExtendedTypes
Description copied from class:JdbcAdapterCalled fromJdbcAdapter.initExtendedTypes(List, List, List, ValueObjectTypeRegistry)to load adapter-specific types into the ExtendedTypeMap right after the default types are loaded, but before the DI overrides are. This method has specific implementations in JdbcAdapter subclasses.- Overrides:
configureExtendedTypesin classJdbcAdapter
-
bindParameter
public void bindParameter(PreparedStatement statement, ParameterBinding binding) throws SQLException, Exception Description copied from interface:DbAdapterBinds an object value to PreparedStatement's parameter.- Specified by:
bindParameterin interfaceDbAdapter- Overrides:
bindParameterin classJdbcAdapter- Throws:
SQLExceptionException
-
createTableAppendColumn
Description copied from class:JdbcAdapterAppends SQL for column creation to CREATE TABLE buffer.- Specified by:
createTableAppendColumnin interfaceDbAdapter- Overrides:
createTableAppendColumnin classJdbcAdapter- Parameters:
buf- theStringBufferto append the column type toat- theDbAttributedefining the column to append type for
-