public class DatasourcePlatform extends java.lang.Object implements Platform
DatabasePlatform,
oracle.toplink.essentials.eis.EISPlatform,
oracle.toplink.essentials.xml.XMLPlatform,
oracle.toplink.essentials.sdk.SDKPlatform,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected ConversionManager |
conversionManager
Allow for conversion to be customized in the platform.
|
protected java.util.Hashtable |
dataTypesConvertedFromAClass
Store the list of Classes that can be converted to from the key.
|
protected java.util.Hashtable |
dataTypesConvertedToAClass
Store the list of Classes that can be converted from to the key.
|
protected Sequence |
defaultSequence
Store default sequence
|
protected java.util.Map |
platformOperators
Operators specific to this platform
|
protected java.util.Map |
sequences
Store map of sequence names to sequences
|
protected java.lang.String |
tableQualifier
Supporting name scopes in database by prefixing the table names with the table qualifier/creator.
|
protected ValueReadQuery |
timestampQuery
Store the query use to query the current server time.
|
| Constructor and Description |
|---|
DatasourcePlatform() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addOperator(ExpressionOperator operator) |
void |
addSequence(Sequence sequence)
Add sequence corresponding to the name
|
void |
appendParameter(Call call,
java.io.Writer writer,
java.lang.Object parameter)
Add the parameter.
|
java.lang.Object |
clone() |
java.lang.Object |
convertObject(java.lang.Object sourceObject,
java.lang.Class javaClass)
Convert the object to the appropriate type by invoking the appropriate
ConversionManager method
|
void |
copyInto(Platform platform)
Copy the state into the new platform.
|
protected Sequence |
createPlatformDefaultSequence()
INTERNAL:
Create platform-default Sequence
|
protected void |
createSequences() |
ConversionManager |
getConversionManager()
The platform hold its own instance of conversion manager to allow customization.
|
java.lang.Object |
getCustomModifyValueForCall(Call call,
java.lang.Object value,
DatabaseField field,
boolean shouldBind)
Allow for the platform to handle the representation of parameters specially.
|
java.util.Vector |
getDataTypesConvertedFrom(java.lang.Class javaClass)
PUBLIC:
Return the list of Classes that can be converted to from the passed in javaClass.
|
java.util.Vector |
getDataTypesConvertedTo(java.lang.Class javaClass)
PUBLIC:
Return the list of Classes that can be converted from to the passed in javaClass.
|
Sequence |
getDefaultSequence()
Get default sequence
|
Sequence |
getDefaultSequenceToWrite()
INTERNAL:
Used only for writing into XML or Java.
|
ExpressionOperator |
getOperator(int selector)
Return the operator for the operator constant defined in ExpressionOperator.
|
java.util.Map |
getPlatformOperators()
Return any platform-specific operators
|
Sequence |
getSequence(java.lang.String seqName)
Get sequence corresponding to the name
|
int |
getSequencePreallocationSize() |
java.util.Map |
getSequences()
INTERNAL:
Returns a map of sequence names to Sequences (may be null).
|
java.util.Map |
getSequencesToWrite()
INTERNAL:
Used only for writing into XML or Java.
|
java.lang.String |
getTableQualifier()
Return the qualifier for the table.
|
java.sql.Timestamp |
getTimestampFromServer(AbstractSession session,
java.lang.String sessionName)
Answer the timestamp from the server.
|
ValueReadQuery |
getTimestampQuery()
This method can be overridden by subclasses to return a
query that will return the timestamp from the server.
|
boolean |
hasDefaultSequence()
Get default sequence
|
protected void |
initializePlatformOperators()
Initialize any platform-specific operators
|
boolean |
isAccess() |
boolean |
isAttunity() |
boolean |
isCloudscape() |
boolean |
isDB2() |
boolean |
isDBase() |
boolean |
isDerby() |
boolean |
isHSQL() |
boolean |
isInformix() |
boolean |
isMySQL() |
boolean |
isODBC() |
boolean |
isOracle() |
boolean |
isPointBase() |
boolean |
isPostgreSQL() |
boolean |
isSQLAnywhere() |
boolean |
isSQLServer() |
boolean |
isSybase() |
boolean |
isTimesTen() |
void |
platformSpecificSequencingInitialization(DatabaseSession session)
INTERNAL:
Platform specific sequencing initialization.
|
void |
removeAllSequences()
Remove all sequences, but the default one.
|
Sequence |
removeSequence(java.lang.String seqName)
Remove sequence corresponding to name.
|
protected void |
sequencesAfterCloneCleanup() |
void |
setConversionManager(ConversionManager conversionManager)
The platform hold its own instance of conversion manager to allow customization.
|
void |
setDefaultSequence(Sequence sequence)
Set default sequence.
|
void |
setSequences(java.util.Map sequences)
INTERNAL:
Sets sequences - for XML support only
|
void |
setTableQualifier(java.lang.String qualifier)
Set the qualifier for the table.
|
void |
setTimestampQuery(ValueReadQuery tsQuery)
Can override the default query for returning a timestamp from the server.
|
boolean |
shouldUseCustomModifyForCall(DatabaseField field)
Used by SQLCall.appendModify(..)
If the field should be passed to customModifyInDatabaseCall, retun true,
otherwise false.
|
java.lang.String |
toString() |
boolean |
usesPlatformDefaultSequence()
INTERNAL:
Indicates whether defaultSequence is the same as platform default sequence.
|
protected java.lang.String tableQualifier
protected transient ConversionManager conversionManager
protected ValueReadQuery timestampQuery
protected transient java.util.Map platformOperators
protected java.util.Hashtable dataTypesConvertedFromAClass
protected java.util.Hashtable dataTypesConvertedToAClass
protected Sequence defaultSequence
protected java.util.Map sequences
protected void addOperator(ExpressionOperator operator)
public void appendParameter(Call call, java.io.Writer writer, java.lang.Object parameter)
appendParameter in interface Platformpublic java.lang.Object getCustomModifyValueForCall(Call call, java.lang.Object value, DatabaseField field, boolean shouldBind)
getCustomModifyValueForCall in interface Platformpublic boolean shouldUseCustomModifyForCall(DatabaseField field)
shouldUseCustomModifyForCall in interface Platformpublic java.lang.Object clone()
protected void sequencesAfterCloneCleanup()
public java.lang.Object convertObject(java.lang.Object sourceObject,
java.lang.Class javaClass)
throws ConversionException
convertObject in interface Platformobject - - the object that must be convertedjavaClass - - the class that the object must be converted to- - ConversionException, all exceptions will be thrown as this type.ConversionExceptionpublic void copyInto(Platform platform)
public ConversionManager getConversionManager()
getConversionManager in interface Platformpublic void setConversionManager(ConversionManager conversionManager)
setConversionManager in interface Platformpublic ExpressionOperator getOperator(int selector)
public java.util.Map getPlatformOperators()
public int getSequencePreallocationSize()
public java.lang.String getTableQualifier()
getTableQualifier in interface Platformpublic java.sql.Timestamp getTimestampFromServer(AbstractSession session, java.lang.String sessionName)
getTimestampFromServer in interface Platformpublic ValueReadQuery getTimestampQuery()
getTimestampQuery in interface Platformprotected void initializePlatformOperators()
public boolean isAttunity()
isAttunity in interface Platformpublic boolean isCloudscape()
isCloudscape in interface Platformpublic boolean isInformix()
isInformix in interface Platformpublic boolean isPointBase()
isPointBase in interface Platformpublic boolean isSQLAnywhere()
isSQLAnywhere in interface Platformpublic boolean isSQLServer()
isSQLServer in interface Platformpublic boolean isTimesTen()
isTimesTen in interface Platformpublic boolean isPostgreSQL()
isPostgreSQL in interface Platformpublic void setTableQualifier(java.lang.String qualifier)
setTableQualifier in interface Platformpublic void setTimestampQuery(ValueReadQuery tsQuery)
setTimestampQuery in interface Platformpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.util.Vector getDataTypesConvertedFrom(java.lang.Class javaClass)
javaClass - - the class that is converted frompublic java.util.Vector getDataTypesConvertedTo(java.lang.Class javaClass)
javaClass - - the class that is converted topublic Sequence getDefaultSequence()
getDefaultSequence in interface Platformpublic boolean hasDefaultSequence()
public void setDefaultSequence(Sequence sequence)
setDefaultSequence in interface Platformpublic void addSequence(Sequence sequence)
addSequence in interface Platformpublic Sequence getSequence(java.lang.String seqName)
getSequence in interface Platformprotected Sequence createPlatformDefaultSequence()
protected void createSequences()
public Sequence removeSequence(java.lang.String seqName)
removeSequence in interface Platformpublic void removeAllSequences()
removeAllSequences in interface Platformpublic java.util.Map getSequences()
getSequences in interface Platformpublic java.util.Map getSequencesToWrite()
getSequencesToWrite in interface Platformpublic Sequence getDefaultSequenceToWrite()
getDefaultSequenceToWrite in interface Platformpublic void setSequences(java.util.Map sequences)
setSequences in interface Platformpublic boolean usesPlatformDefaultSequence()
usesPlatformDefaultSequence in interface Platformpublic void platformSpecificSequencingInitialization(DatabaseSession session)
platformSpecificSequencingInitialization in interface Platform