|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jpox.store.AbstractDatastoreAdapter
Generalised datastore representation. Each datastore is assumed to have a "name", and a "version" (of the form major.minor.revision) and will store "identifiers". In addition, each field will have a Mapping to the datastore
This will typically be extended to provide e.g RDBMS connection using JDBC, or XML file connection using a DOM parser.
Field Summary | |
protected int |
datastoreMajorVersion
The major version number of the underlying datastore. |
protected int |
datastoreMinorVersion
The minor version number of the underlying datastore. |
protected java.lang.String |
datastoreProductName
The product name of the underlying datastore. |
protected java.lang.String |
datastoreProductVersion
The version number of the underlying datastore as a string. |
protected int |
datastoreRevisionVersion
The revision version number of the underlying datastore. |
protected Dictionary |
dictionary
The dictionary to use for identifiers etc. |
protected int |
identifierCase
Case that the identifiers will be stored in. |
protected java.lang.String |
identifierQuoteString
The String used to quote identifiers. |
protected static Localiser |
LOCALISER_BASE
|
protected MappingManager |
mappingManager
Manager for the mapping between Java and datastore types. |
protected java.util.HashSet |
reservedKeywords
The set of reserved keywords for this datastore. |
Fields inherited from interface org.jpox.store.DatastoreAdapter |
IDENTIFIER_LOWER_CASE, IDENTIFIER_LOWER_CASE_QUOTED, IDENTIFIER_MIXED_CASE, IDENTIFIER_MIXED_CASE_QUOTED, IDENTIFIER_UPPER_CASE, IDENTIFIER_UPPER_CASE_QUOTED |
Constructor Summary | |
AbstractDatastoreAdapter(Dictionary dictionary)
Constructor. |
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. |
Dictionary |
getDictionary()
Accessor for the Dictionary. |
int |
getIdentifierCase()
Accessor for the case that the identifiers will be specified in |
java.lang.String |
getIdentifierInAdapterCase(java.lang.String identifier)
Convenience method to convert the passed identifier into an identifier in the correct case, and with any required quoting. |
java.lang.String |
getIdentifierQuoteString()
Accessor for an identifier quote string. |
JavaTypeMapping |
getMapping(java.lang.Class c,
boolean serialised,
boolean embedded,
StoreManager storeMgr,
ClassLoaderResolver clr)
Convenience accessor for the mapping for the specified class. |
JavaTypeMapping |
getMapping(java.lang.Class c,
boolean serialised,
boolean embedded,
java.lang.String fieldName,
StoreManager storeMgr)
Convenience accessor for the mapping for the specified class. |
protected JavaTypeMapping |
getMapping(java.lang.Class c,
ScalarExpression expr)
Convenience accessor for the mapping for the specified class. |
JavaTypeMapping |
getMapping(java.lang.Class c,
StoreManager storeMgr)
Convenience accessor for the mapping for the specified class. |
JavaTypeMapping |
getMapping(java.lang.Class c,
StoreManager storeMgr,
ClassLoaderResolver clr)
Convenience accessor for the mapping for the specified class. |
MappingManager |
getMappingManager()
Acessor for the MappingManager |
protected int |
getMiliseconds(long nanos)
|
protected abstract MappingManager |
getNewMappingManager()
Accessor for a new mapping manager. |
protected long |
getTime(long time,
long nanos)
|
java.lang.String |
getVendorID()
Accessor for the Vendor ID for this datastore. |
boolean |
isReservedKeyword(java.lang.String word)
Method to check if a word is reserved for this datastore. |
void |
loadDatastoreMapping(PluginManager mgr,
ClassLoaderResolver clr)
Load the datastore mapping declared as Plug-in |
NumericExpression |
modOperator(ScalarExpression operand1,
ScalarExpression operand2)
Method to generate a modulus expression. |
abstract QueryExpression |
newQueryStatement(DatastoreContainerObject container,
ClassLoaderResolver clr)
Accessor for a new query statement. |
abstract QueryExpression |
newQueryStatement(DatastoreContainerObject container,
DatastoreIdentifier rangeVar,
ClassLoaderResolver clr)
Accessor for a new query statement. |
boolean |
supportsAutoIncrementFields()
Accessor for whether autoincrementing fields are supported. |
boolean |
supportsQueryFetchSizeLowerThanOne()
Whether the datastore supports setting a fetch size lower than one. |
boolean |
supportsSequences()
Accessor for whether sequences are supported. |
java.lang.String |
toString()
Method to return this object as a string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.jpox.store.DatastoreAdapter |
closeConnection, getConnection, initialiseDatastore, isAutoIncrementingDataType |
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, getDayMethod, getHourMethod, getMinuteMethod, getMonthMethod, getSecondMethod, getYearMethod, indexOfMethod, lengthMethod, logMethod, sinMethod, sqrtMethod, startsWithMethod, substringMethod, substringMethod, tanMethod, 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 |
Field Detail |
protected static final Localiser LOCALISER_BASE
protected final java.util.HashSet reservedKeywords
protected java.lang.String datastoreProductName
protected java.lang.String datastoreProductVersion
protected int datastoreMajorVersion
protected int datastoreMinorVersion
protected int datastoreRevisionVersion
protected int identifierCase
protected java.lang.String identifierQuoteString
protected Dictionary dictionary
protected MappingManager mappingManager
Constructor Detail |
public AbstractDatastoreAdapter(Dictionary dictionary)
dictionary
- The dictionary to use for identifiersMethod Detail |
protected abstract MappingManager getNewMappingManager()
public void loadDatastoreMapping(PluginManager mgr, ClassLoaderResolver clr)
loadDatastoreMapping
in interface DatastoreAdapter
mgr
- the PluginManagerclr
- the ClassLoaderResolverpublic MappingManager getMappingManager()
getMappingManager
in interface DatastoreAdapter
public JavaTypeMapping getMapping(java.lang.Class c, StoreManager storeMgr)
getMapping
in interface DatastoreAdapter
c
- Java typestoreMgr
- the StoreManager
public JavaTypeMapping getMapping(java.lang.Class c, boolean serialised, boolean embedded, java.lang.String fieldName, StoreManager storeMgr)
getMapping
in interface DatastoreAdapter
c
- Java typeserialised
- Whether the type is serialisedembedded
- Whether the type is embeddedfieldName
- Name of field (for logging only).storeMgr
- the StoreManager
public JavaTypeMapping getMapping(java.lang.Class c, StoreManager storeMgr, ClassLoaderResolver clr)
getMapping
in interface DatastoreAdapter
c
- Java typestoreMgr
- The Store managerclr
- ClassLoader resolver
protected final JavaTypeMapping getMapping(java.lang.Class c, ScalarExpression expr)
c
- Java typeexpr
- the ScalarExpression
public JavaTypeMapping getMapping(java.lang.Class c, boolean serialised, boolean embedded, StoreManager storeMgr, ClassLoaderResolver clr)
getMapping
in interface DatastoreAdapter
c
- Java typeserialised
- Whether the type is serialisedembedded
- Whether the type is embeddedstoreMgr
- The Store managerclr
- ClassLoader resolver
public java.lang.String getVendorID()
DatastoreAdapter
getVendorID
in interface DatastoreAdapter
public boolean isReservedKeyword(java.lang.String word)
DatastoreAdapter
isReservedKeyword
in interface DatastoreAdapter
word
- The word
public int getIdentifierCase()
getIdentifierCase
in interface DatastoreAdapter
public java.lang.String getIdentifierQuoteString()
getIdentifierQuoteString
in interface DatastoreAdapter
public java.lang.String getIdentifierInAdapterCase(java.lang.String identifier)
getIdentifierInAdapterCase
in interface DatastoreAdapter
identifier
- The identifier
public abstract QueryExpression newQueryStatement(DatastoreContainerObject container, ClassLoaderResolver clr)
DatastoreAdapter
newQueryStatement
in interface DatastoreAdapter
container
- The table to queryclr
- the ClassLoaderResolver
public abstract QueryExpression newQueryStatement(DatastoreContainerObject container, DatastoreIdentifier rangeVar, ClassLoaderResolver clr)
DatastoreAdapter
newQueryStatement
in interface DatastoreAdapter
container
- The table to queryrangeVar
- A range variable for the queryclr
- the ClassLoaderResolver
public Dictionary getDictionary()
DatastoreAdapter
getDictionary
in interface DatastoreAdapter
public long getAdapterTime(java.sql.Timestamp time)
DatastoreAdapter
getAdapterTime
in interface DatastoreAdapter
time
- The timestamp
protected long getTime(long time, long nanos)
protected int getMiliseconds(long nanos)
public int getDatastoreMajorVersion()
DatastoreAdapter
getDatastoreMajorVersion
in interface DatastoreAdapter
public int getDatastoreMinorVersion()
DatastoreAdapter
getDatastoreMinorVersion
in interface DatastoreAdapter
public NumericExpression modOperator(ScalarExpression operand1, ScalarExpression operand2)
DatastoreAdapter
modOperator
in interface DatastoreAdapter
operand1
- the left expressionoperand2
- the right expression
public boolean supportsAutoIncrementFields()
supportsAutoIncrementFields
in interface DatastoreAdapter
public boolean supportsSequences()
supportsSequences
in interface DatastoreAdapter
public boolean supportsQueryFetchSizeLowerThanOne()
supportsQueryFetchSizeLowerThanOne
in interface DatastoreAdapter
public java.lang.String toString()
DatastoreAdapter
toString
in interface DatastoreAdapter
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |