org.datanucleus.store.mapped
Interface DatastoreAdapter


public interface DatastoreAdapter

Definition of a datastore adapter.


Field Summary
static java.lang.String ANALYSIS_METHODS
          Accessor for whether the SQL extensions CUBE, ROLLUP are supported.
static java.lang.String BIT_IS_REALLY_BOOLEAN
          Whether "Types.BIT" is really mapped as BOOLEAN.
static java.lang.String BOOLEAN_COMPARISON
          Whether we support Boolean comparisons.
static java.lang.String CATALOGS_IN_TABLE_DEFINITIONS
          Whether this datastore supports the use of the catalog name in ORM table definitions (DDL).
static java.lang.String ESCAPE_EXPRESSION_IN_LIKE_PREDICATE
           
static java.lang.String IDENTIFIERS_LOWERCASE
           
static java.lang.String IDENTIFIERS_LOWERCASE_QUOTED
           
static java.lang.String IDENTIFIERS_MIXEDCASE
           
static java.lang.String IDENTIFIERS_MIXEDCASE_QUOTED
           
static java.lang.String IDENTIFIERS_MIXEDCASE_QUOTED_SENSITIVE
           
static java.lang.String IDENTIFIERS_MIXEDCASE_SENSITIVE
           
static java.lang.String IDENTIFIERS_UPPERCASE
           
static java.lang.String IDENTIFIERS_UPPERCASE_QUOTED
           
static java.lang.String IDENTITY_COLUMNS
          Whether this datastore adapter support identity fields.
static java.lang.String PROJECTION_IN_TABLE_REFERENCE_JOINS
          Whether this datastore supports "SELECT a.* FROM (SELECT * FROM TBL1 INNER JOIN TBL2 ON tbl1.x = tbl2.y ) a" If the database does not support the SQL statement generated is like "SELECT a.* FROM (TBL1 INNER JOIN TBL2 ON tbl1.x = tbl2.y ) a"
static java.lang.String SCHEMAS_IN_TABLE_DEFINITIONS
          Whether this datastore supports the use of the schema name in ORM table definitions (DDL).
static java.lang.String SEQUENCES
          Whether we support sequences.
 
Method Summary
 long getAdapterTime(java.sql.Timestamp time)
          Utility to return the adapter time in case there are rounding issues with millisecs etc.
 java.lang.String getCatalogSeparator()
          Accessor for the catalog separator (string to separate the catalog/schema and the identifier).
 int getDatastoreIdentifierMaxLength(IdentifierType identifierType)
          Method to return the maximum length of a datastore identifier of the specified type.
 int getDatastoreMajorVersion()
          Accessor for the datastore major version number.
 int getDatastoreMinorVersion()
          Accessor for the datastore minor version number.
 java.lang.String getIdentifierQuoteString()
          Accessor for the quote string to use when quoting identifiers.
 MappingManager getMappingManager(MappedStoreManager storeMgr)
          Accessor for a Mapping Manager suitable for use with this datastore adapter.
 int getMaxForeignKeys()
          Accessor for the maximum foreign keys by table permitted in this datastore.
 int getMaxIndexes()
          Accessor for the maximum indexes by table permitted in this datastore.
 java.util.Collection<java.lang.String> getSupportedOptions()
          Accessor for the options that are supported by this datastore adapter and the underlying datastore.
 java.lang.String getVendorID()
          Accessor for the Vendor ID for this datastore.
 void initialiseDatastore(java.lang.Object conn)
          Creates the auxiliary functions/procedures in the datastore
 void initialiseTypes(StoreSchemaHandler handler, ManagedConnection mconn)
          Initialise the types for this datastore.
 boolean isIdentityFieldDataType(java.lang.String columnDef)
          Verifies if the given columnDef is an identity field type for the datastore.
 boolean isReservedKeyword(java.lang.String word)
          Method to check if a word is reserved for this datastore.
 void removeUnsupportedMappings(StoreSchemaHandler handler, ManagedConnection mconn)
          Remove all mappings from the mapping manager that don't have a datastore type initialised.
 void setProperties(java.util.Map<java.lang.String,java.lang.Object> props)
          Set any properties controlling how the adapter is configured.
 boolean supportsOption(java.lang.String option)
          Accessor for whether the supplied option is supported.
 boolean supportsQueryFetchSize(int size)
          Whether the datastore will support setting the query fetch size to the supplied value.
 java.lang.String toString()
          Method to return this object as a string.
 

Field Detail

IDENTITY_COLUMNS

static final java.lang.String IDENTITY_COLUMNS
Whether this datastore adapter support identity fields. In SQL this would be things like "AUTOINCREMENT", "IDENTITY", "SERIAL".

See Also:
Constant Field Values

SEQUENCES

static final java.lang.String SEQUENCES
Whether we support sequences.

See Also:
Constant Field Values

BIT_IS_REALLY_BOOLEAN

static final java.lang.String BIT_IS_REALLY_BOOLEAN
Whether "Types.BIT" is really mapped as BOOLEAN.

See Also:
Constant Field Values

BOOLEAN_COMPARISON

static final java.lang.String BOOLEAN_COMPARISON
Whether we support Boolean comparisons.

See Also:
Constant Field Values

ESCAPE_EXPRESSION_IN_LIKE_PREDICATE

static final java.lang.String ESCAPE_EXPRESSION_IN_LIKE_PREDICATE
See Also:
Constant Field Values

PROJECTION_IN_TABLE_REFERENCE_JOINS

static final java.lang.String PROJECTION_IN_TABLE_REFERENCE_JOINS
Whether this datastore supports "SELECT a.* FROM (SELECT * FROM TBL1 INNER JOIN TBL2 ON tbl1.x = tbl2.y ) a" If the database does not support the SQL statement generated is like "SELECT a.* FROM (TBL1 INNER JOIN TBL2 ON tbl1.x = tbl2.y ) a"

See Also:
Constant Field Values

ANALYSIS_METHODS

static final java.lang.String ANALYSIS_METHODS
Accessor for whether the SQL extensions CUBE, ROLLUP are supported. TODO Move this to a plugin extension as cube and rollup options (separate)

See Also:
Constant Field Values

CATALOGS_IN_TABLE_DEFINITIONS

static final java.lang.String CATALOGS_IN_TABLE_DEFINITIONS
Whether this datastore supports the use of the catalog name in ORM table definitions (DDL).

See Also:
Constant Field Values

SCHEMAS_IN_TABLE_DEFINITIONS

static final java.lang.String SCHEMAS_IN_TABLE_DEFINITIONS
Whether this datastore supports the use of the schema name in ORM table definitions (DDL).

See Also:
Constant Field Values

IDENTIFIERS_LOWERCASE

static final java.lang.String IDENTIFIERS_LOWERCASE
See Also:
Constant Field Values

IDENTIFIERS_MIXEDCASE

static final java.lang.String IDENTIFIERS_MIXEDCASE
See Also:
Constant Field Values

IDENTIFIERS_UPPERCASE

static final java.lang.String IDENTIFIERS_UPPERCASE
See Also:
Constant Field Values

IDENTIFIERS_LOWERCASE_QUOTED

static final java.lang.String IDENTIFIERS_LOWERCASE_QUOTED
See Also:
Constant Field Values

IDENTIFIERS_MIXEDCASE_QUOTED

static final java.lang.String IDENTIFIERS_MIXEDCASE_QUOTED
See Also:
Constant Field Values

IDENTIFIERS_UPPERCASE_QUOTED

static final java.lang.String IDENTIFIERS_UPPERCASE_QUOTED
See Also:
Constant Field Values

IDENTIFIERS_MIXEDCASE_SENSITIVE

static final java.lang.String IDENTIFIERS_MIXEDCASE_SENSITIVE
See Also:
Constant Field Values

IDENTIFIERS_MIXEDCASE_QUOTED_SENSITIVE

static final java.lang.String IDENTIFIERS_MIXEDCASE_QUOTED_SENSITIVE
See Also:
Constant Field Values
Method Detail

getSupportedOptions

java.util.Collection<java.lang.String> getSupportedOptions()
Accessor for the options that are supported by this datastore adapter and the underlying datastore.

Returns:
The options (Collection)

supportsOption

boolean supportsOption(java.lang.String option)
Accessor for whether the supplied option is supported.

Parameters:
option - The option
Returns:
Whether supported.

getMappingManager

MappingManager getMappingManager(MappedStoreManager storeMgr)
Accessor for a Mapping Manager suitable for use with this datastore adapter.

Parameters:
storeMgr - The StoreManager
Returns:
The Mapping Manager.

getVendorID

java.lang.String getVendorID()
Accessor for the Vendor ID for this datastore.

Returns:
Vendor id for this datastore

initialiseTypes

void initialiseTypes(StoreSchemaHandler handler,
                     ManagedConnection mconn)
Initialise the types for this datastore.

Parameters:
handler - SchemaHandler that we initialise the types for
mconn - Managed connection to use

setProperties

void setProperties(java.util.Map<java.lang.String,java.lang.Object> props)
Set any properties controlling how the adapter is configured.

Parameters:
props - The properties

removeUnsupportedMappings

void removeUnsupportedMappings(StoreSchemaHandler handler,
                               ManagedConnection mconn)
Remove all mappings from the mapping manager that don't have a datastore type initialised.

Parameters:
handler - Schema handler
mconn - Managed connection to use

isReservedKeyword

boolean isReservedKeyword(java.lang.String word)
Method to check if a word is reserved for this datastore.

Parameters:
word - The word
Returns:
Whether it is reserved

initialiseDatastore

void initialiseDatastore(java.lang.Object conn)
Creates the auxiliary functions/procedures in the datastore

Parameters:
conn - the connection to the datastore

getIdentifierQuoteString

java.lang.String getIdentifierQuoteString()
Accessor for the quote string to use when quoting identifiers.

Returns:
The quote string for the identifier

getCatalogSeparator

java.lang.String getCatalogSeparator()
Accessor for the catalog separator (string to separate the catalog/schema and the identifier).

Returns:
Catalog separator string.

getAdapterTime

long getAdapterTime(java.sql.Timestamp time)
Utility to return the adapter time in case there are rounding issues with millisecs etc.

Parameters:
time - The timestamp
Returns:
The time in millisecs

getDatastoreMajorVersion

int getDatastoreMajorVersion()
Accessor for the datastore major version number.

Returns:
Major version number

getDatastoreMinorVersion

int getDatastoreMinorVersion()
Accessor for the datastore minor version number.

Returns:
Minor version number

isIdentityFieldDataType

boolean isIdentityFieldDataType(java.lang.String columnDef)
Verifies if the given columnDef is an identity field type for the datastore.

Parameters:
columnDef - the datastore type name
Returns:
true when the columnDef has values for identity generation in the datastore

getDatastoreIdentifierMaxLength

int getDatastoreIdentifierMaxLength(IdentifierType identifierType)
Method to return the maximum length of a datastore identifier of the specified type. If no limit exists then returns -1

Parameters:
identifierType - Type of identifier
Returns:
The max permitted length of this type of identifier

getMaxForeignKeys

int getMaxForeignKeys()
Accessor for the maximum foreign keys by table permitted in this datastore.

Returns:
Max number of foreign keys

getMaxIndexes

int getMaxIndexes()
Accessor for the maximum indexes by table permitted in this datastore.

Returns:
Max number of indices

supportsQueryFetchSize

boolean supportsQueryFetchSize(int size)
Whether the datastore will support setting the query fetch size to the supplied value.

Parameters:
size - The value to set to
Returns:
Whether it is supported.

toString

java.lang.String toString()
Method to return this object as a string.

Overrides:
toString in class java.lang.Object
Returns:
String version of this object.


Copyright © 2011. All Rights Reserved.