Package org.apache.cayenne.dba.sqlserver
Class SQLServerAdapter
java.lang.Object
org.apache.cayenne.dba.JdbcAdapter
org.apache.cayenne.dba.sybase.SybaseAdapter
org.apache.cayenne.dba.sqlserver.SQLServerAdapter
- All Implemented Interfaces:
- DbAdapter
Cayenne DbAdapter implementation for Microsoft SQL Server engine.
Microsoft Driver Settings
Sample connection settings to use with MS SQL Server are shown below:
       sqlserver.jdbc.username = test
       sqlserver.jdbc.password = secret
       sqlserver.jdbc.url = jdbc:sqlserver://192.168.0.65;databaseName=cayenne;SelectMethod=cursor
       sqlserver.jdbc.driver = com.microsoft.sqlserver.jdbc.SQLServerDriver
 
 Note on case-sensitive LIKE: if your application requires case-sensitive LIKE support, ask your DBA to configure the database to use a case-senstitive collation (one with "CS" in symbolic collation name instead of "CI", e.g. "SQL_Latin1_general_CP1_CS_AS").
jTDS Driver Settings
jTDS is an open source driver that can be downloaded from http://jtds.sourceforge.net . It supports both SQLServer and Sybase. Sample SQLServer settings are the following:
       sqlserver.jdbc.username = test
       sqlserver.jdbc.password = secret
       sqlserver.jdbc.url = jdbc:jtds:sqlserver://192.168.0.65/cayenne
       sqlserver.jdbc.driver = net.sourceforge.jtds.jdbc.Driver
 - Since:
- 1.1
- 
Field SummaryFields inherited from class org.apache.cayenne.dba.JdbcAdaptercaseInsensitiveCollations, ejbqlTranslatorFactory, extendedTypes, logger, quotingStrategy, resourceLocator, supportsBatchUpdates, supportsGeneratedKeys, supportsUniqueConstraints, typesHandler
- 
Constructor SummaryConstructorsConstructorDescriptionSQLServerAdapter(RuntimeProperties runtimeProperties, List<ExtendedType> defaultExtendedTypes, List<ExtendedType> userExtendedTypes, List<ExtendedTypeFactory> extendedTypeFactories, ResourceLocator resourceLocator, ValueObjectTypeRegistry valueObjectTypeRegistry) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidInstalls appropriate ExtendedTypes as converters for passing values between JDBC and Java layers.createUniqueConstraint(DbEntity source, Collection<DbAttribute> columns) Generates DDL to create unique index that allows multiple NULL values to comply with ANSI SQL, that is default behaviour for other RDBMS.Uses SQLServerActionBuilder to create the right action.voidsetVersion(Integer version) booleanNot supported, see: mssql-jdbc #245Methods inherited from class org.apache.cayenne.dba.sybase.SybaseAdapterbindParameter, createEJBQLTranslatorFactory, createQuotingStrategy, createTableAppendColumn, getBatchTerminatorMethods inherited from class org.apache.cayenne.dba.JdbcAdapterbuildAttribute, createFkConstraint, createTable, createTableAppendPKClause, dropTableStatements, externalTypesForJdbcType, findResource, getEjbqlTranslatorFactory, getExtendedTypes, getJdbcEventLogger, getPkGenerator, getQuotingStrategy, getSelectTranslator, getType, initExtendedTypes, setEjbqlTranslatorFactory, setPkGenerator, setSupportsBatchUpdates, setSupportsGeneratedKeys, setSupportsUniqueConstraints, sizeAndPrecision, supportsBatchUpdates, supportsCatalogsOnReverseEngineering, supportsGeneratedKeys, supportsUniqueConstraints, tableTypeForTable, tableTypeForView, typeSupportsLength, typeSupportsScale, unwrap
- 
Constructor Details- 
SQLServerAdapterpublic SQLServerAdapter(RuntimeProperties runtimeProperties, List<ExtendedType> defaultExtendedTypes, List<ExtendedType> userExtendedTypes, List<ExtendedTypeFactory> extendedTypeFactories, ResourceLocator resourceLocator, ValueObjectTypeRegistry valueObjectTypeRegistry) 
 
- 
- 
Method Details- 
supportsGeneratedKeysForBatchInsertspublic boolean supportsGeneratedKeysForBatchInserts()Not supported, see: mssql-jdbc #245- See Also:
 
- 
getSqlTreeProcessor- Specified by:
- getSqlTreeProcessorin interface- DbAdapter
- Overrides:
- getSqlTreeProcessorin class- SybaseAdapter
- Returns:
- SQLTreeProcessorthat can adjust SQL tree to specific database flavour
- Since:
- 4.2
 
- 
configureExtendedTypesDescription copied from class:SybaseAdapterInstalls appropriate ExtendedTypes as converters for passing values between JDBC and Java layers.- Overrides:
- configureExtendedTypesin class- SybaseAdapter
 
- 
getActionUses SQLServerActionBuilder to create the right action.- Specified by:
- getActionin interface- DbAdapter
- Overrides:
- getActionin class- JdbcAdapter
- Since:
- 1.2
 
- 
getSystemSchemas- Specified by:
- getSystemSchemasin interface- DbAdapter
- Overrides:
- getSystemSchemasin class- JdbcAdapter
- Returns:
- list of system schemas
 
- 
getSystemCatalogs- Specified by:
- getSystemCatalogsin interface- DbAdapter
- Overrides:
- getSystemCatalogsin class- JdbcAdapter
- Returns:
- list of system catalogs
 
- 
getVersion
- 
setVersion- Parameters:
- version- of the server as provided by the JDBC driver
- Since:
- 4.2
 
- 
createUniqueConstraintGenerates DDL to create unique index that allows multiple NULL values to comply with ANSI SQL, that is default behaviour for other RDBMS.
 Example:CREATE UNIQUE NONCLUSTERED INDEX _idx_entity_attribute ON entity(attribute) WHERE attribute IS NOT NULL- Specified by:
- createUniqueConstraintin interface- DbAdapter
- Overrides:
- createUniqueConstraintin class- JdbcAdapter
- Parameters:
- source- entity for the index
- columns- source columns for the index
- Returns:
- DDL to create unique index
- Since:
- 4.2.1
 
 
-