org.jpox.store
Interface DatastoreAdapter

All Superinterfaces:
ExpressionConversionAdapter, ExpressionLogicSetAdapter, ExpressionMethodAdapter, ExpressionOperatorAdapter, ExpressionPatternAdapter, ExpressionSupportedFeaturesAdapter
All Known Implementing Classes:
AbstractDatastoreAdapter

public interface DatastoreAdapter
extends ExpressionConversionAdapter, ExpressionOperatorAdapter, ExpressionMethodAdapter, ExpressionSupportedFeaturesAdapter, ExpressionPatternAdapter, ExpressionLogicSetAdapter

Definition of a datastore adapter.

Version:
$Revision: 1.35 $

Method Summary
 long getAdapterTime(java.sql.Timestamp time)
          Utility to return the adapter time in case there are rounding issues with millisecs etc.
 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.
 JavaTypeMapping getMapping(java.lang.Class c, MappedStoreManager storeMgr)
          Accessor for the mapping for the specified class assuming that the type is not serialised and not embedded.
 JavaTypeMapping getMapping(java.lang.Class c, MappedStoreManager storeMgr, boolean serialised, boolean embedded, java.lang.String fieldName)
          Accessor for the mapping for the specified class.
 JavaTypeMapping getMapping(java.lang.Class c, MappedStoreManager storeMgr, ClassLoaderResolver clr)
          Accessor for the mapping for the specified class assuming that the type is not serialised and not embedded.
 JavaTypeMapping getMapping(java.lang.Class c, MappedStoreManager storeMgr, ClassLoaderResolver clr, boolean serialised, boolean embedded)
          Accessor for the mapping for the specified class.
 MappingManager getMappingManager()
          Accessor for the Mapping Manager for field mapping management.
 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
 boolean isBitReallyBoolean()
          Accessor for whether bit is really mapped in the datastore to boolean.
 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.
 boolean isStoresLowerCaseIdentifiers()
          Accessor for whether this adapter stores lower case identifiers.
 boolean isStoresLowerCaseQuotedIdentifiers()
          Accessor for whether this adapter stores "lowercase" identifiers.
 boolean isStoresMixedCaseIdentifiers()
          Accessor for whether this adapter stores MixedCase identifiers.
 boolean isStoresMixedCaseQuotedIdentifiers()
          Accessor for whether this adapter "MixedCase" identifiers.
 boolean isStoresUpperCaseIdentifiers()
          Accessor for whether this adapter stores UPPERCASE identifiers.
 boolean isStoresUpperCaseQuotedIdentifiers()
          Accessor for whether this adapter stores "UPPERCASE" identifiers.
 void loadDatastoreMapping(PluginManager mgr, ClassLoaderResolver clr)
          Load the datastore mappings declared as Plug-in
 NumericExpression modOperator(ScalarExpression operand1, ScalarExpression operand2)
          Method to generate a modulus expression.
 QueryExpression newQueryStatement(DatastoreContainerObject container, ClassLoaderResolver clr)
          Accessor for a new query statement.
 QueryExpression newQueryStatement(DatastoreContainerObject container, DatastoreIdentifier rangeVar, ClassLoaderResolver clr)
          Accessor for a new query statement.
 boolean supportsIdentityFields()
          Whether this datastore adapter support identity fields.
 boolean supportsProjectionInTableReferenceJoins()
          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"
 boolean supportsQueryFetchSize(int size)
          Whether the datastore will support setting the query fetch size to the supplied value.
 boolean supportsSequences()
          Whether this datastore adapter supports sequences.
 java.lang.String toString()
          Method to return this object as a string.
 
Methods inherited from interface org.jpox.store.expression.ExpressionConversionAdapter
toNumericExpression, toStringExpression, toStringExpression
 
Methods inherited from interface org.jpox.store.expression.ExpressionOperatorAdapter
concatOperator, getOperatorConcat
 
Methods inherited from interface org.jpox.store.expression.ExpressionMethodAdapter
absMethod, acosMethod, asinMethod, atanMethod, ceilMethod, cosMethod, endsWithMethod, expMethod, floorMethod, getCurrentDateMethod, getCurrentTimeMethod, getCurrentTimestampMethod, getDayMethod, getHourMethod, getMinuteMethod, getMonthMethod, getSecondMethod, getYearMethod, indexOfMethod, lengthMethod, logMethod, matchesMethod, sinMethod, sqrtMethod, startsWithMethod, substringMethod, substringMethod, tanMethod, translateMethod, trimMethod
 
Methods inherited from interface org.jpox.store.expression.ExpressionSupportedFeaturesAdapter
supportsBooleanComparison, supportsEscapeExpressionInLikePredicate
 
Methods inherited from interface org.jpox.store.expression.ExpressionPatternAdapter
getEscapeCharacter, getEscapedPatternExpression, getEscapePatternExpression, getPatternExpressionAnyCharacter, getPatternExpressionZeroMoreCharacters
 
Methods inherited from interface org.jpox.store.expression.ExpressionLogicSetAdapter
cartersianProduct
 

Method Detail

getMappingManager

MappingManager getMappingManager()
Accessor for the Mapping Manager for field mapping management.

Returns:
The Mapping Manager.

getVendorID

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

Returns:
Vendor id for this datastore

loadDatastoreMapping

void loadDatastoreMapping(PluginManager mgr,
                          ClassLoaderResolver clr)
Load the datastore mappings declared as Plug-in

Parameters:
mgr - the PluginManager
clr - the ClassLoaderResolver

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

newQueryStatement

QueryExpression newQueryStatement(DatastoreContainerObject container,
                                  ClassLoaderResolver clr)
Accessor for a new query statement.

Parameters:
container - The table to query
clr - the ClassLoaderResolver
Returns:
The Query Statement

newQueryStatement

QueryExpression newQueryStatement(DatastoreContainerObject container,
                                  DatastoreIdentifier rangeVar,
                                  ClassLoaderResolver clr)
Accessor for a new query statement.

Parameters:
container - The table to query
rangeVar - A range variable for the query
clr - the ClassLoaderResolver
Returns:
The Query Statement

getMapping

JavaTypeMapping getMapping(java.lang.Class c,
                           MappedStoreManager storeMgr)
Accessor for the mapping for the specified class assuming that the type is not serialised and not embedded.

Parameters:
c - Java type
storeMgr - the StoreManager
Returns:
The mapping for the class.

getMapping

JavaTypeMapping getMapping(java.lang.Class c,
                           MappedStoreManager storeMgr,
                           boolean serialised,
                           boolean embedded,
                           java.lang.String fieldName)
Accessor for the mapping for the specified class. TODO Why use this and not the one with ClassLoaderResolver ?

Parameters:
c - Java type
storeMgr - the StoreManager
serialised - Whether the type is serialised
embedded - Whether the type is embedded
fieldName - Name of field (for logging only)
Returns:
The mapping for the class.

getMapping

JavaTypeMapping getMapping(java.lang.Class c,
                           MappedStoreManager storeMgr,
                           ClassLoaderResolver clr)
Accessor for the mapping for the specified class assuming that the type is not serialised and not embedded.

Parameters:
c - Class to query
storeMgr - The Store Manager
clr - The ClassLoaderResolver
Returns:
The mapping for the class.

getMapping

JavaTypeMapping getMapping(java.lang.Class c,
                           MappedStoreManager storeMgr,
                           ClassLoaderResolver clr,
                           boolean serialised,
                           boolean embedded)
Accessor for the mapping for the specified class. TODO Why use this and not the one without ClassLoaderResolver ?

Parameters:
c - Class to query
storeMgr - The Store Manager
clr - The ClassLoaderResolver
serialised - Whether the type is serialised
embedded - Whether the type is embedded
Returns:
The mapping for the class.

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

modOperator

NumericExpression modOperator(ScalarExpression operand1,
                              ScalarExpression operand2)
Method to generate a modulus expression. The binary % operator is said to yield the remainder of its operands from an implied division; the left-hand operand is the dividend and the right-hand operand is the divisor.

Specified by:
modOperator in interface ExpressionOperatorAdapter
Parameters:
operand1 - the left expression
operand2 - the right expression
Returns:
The Expression for modulus

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

supportsIdentityFields

boolean supportsIdentityFields()
Whether this datastore adapter support identity fields. The column could be things like "AUTOINCREMENT", "IDENTITY", "SERIAL" in SQL.

Returns:
whether identity fields are supported.

supportsSequences

boolean supportsSequences()
Whether this datastore adapter supports sequences.

Returns:
whether sequences are supported.

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.

supportsProjectionInTableReferenceJoins

boolean supportsProjectionInTableReferenceJoins()
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"

Returns:
whether we support project in subqueries joins

isStoresLowerCaseIdentifiers

boolean isStoresLowerCaseIdentifiers()
Accessor for whether this adapter stores lower case identifiers.

Returns:
Whether lowercase identifiers are stored

isStoresLowerCaseQuotedIdentifiers

boolean isStoresLowerCaseQuotedIdentifiers()
Accessor for whether this adapter stores "lowercase" identifiers.

Returns:
Whether "lowercase" identifiers are stored

isStoresMixedCaseIdentifiers

boolean isStoresMixedCaseIdentifiers()
Accessor for whether this adapter stores MixedCase identifiers.

Returns:
Whether MixedCase identifiers are stored

isStoresMixedCaseQuotedIdentifiers

boolean isStoresMixedCaseQuotedIdentifiers()
Accessor for whether this adapter "MixedCase" identifiers.

Returns:
Whether "MixedCase" identifiers are stored

isStoresUpperCaseIdentifiers

boolean isStoresUpperCaseIdentifiers()
Accessor for whether this adapter stores UPPERCASE identifiers.

Returns:
Whether UPPERCASE identifiers are stored

isStoresUpperCaseQuotedIdentifiers

boolean isStoresUpperCaseQuotedIdentifiers()
Accessor for whether this adapter stores "UPPERCASE" identifiers.

Returns:
Whether "UPPERCASE" identifiers are stored

isBitReallyBoolean

boolean isBitReallyBoolean()
Accessor for whether bit is really mapped in the datastore to boolean. TODO Abstract this out to RDBMS

Returns:
Whether bit is really stored as a boolean

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 © -2008 . All Rights Reserved.