public class DatasourcePlatform extends Object implements Platform
DatabasePlatform
,
oracle.toplink.essentials.eis.EISPlatform
,
oracle.toplink.essentials.xml.XMLPlatform
,
oracle.toplink.essentials.sdk.SDKPlatform
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected ConversionManager |
conversionManager
Allow for conversion to be customized in the platform.
|
protected Hashtable |
dataTypesConvertedFromAClass
Store the list of Classes that can be converted to from the key.
|
protected Hashtable |
dataTypesConvertedToAClass
Store the list of Classes that can be converted from to the key.
|
protected Sequence |
defaultSequence
Store default sequence
|
protected Map |
platformOperators
Operators specific to this platform
|
protected Map |
sequences
Store map of sequence names to sequences
|
protected 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,
Writer writer,
Object parameter)
Add the parameter.
|
Object |
clone() |
Object |
convertObject(Object sourceObject,
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.
|
Object |
getCustomModifyValueForCall(Call call,
Object value,
DatabaseField field,
boolean shouldBind)
Allow for the platform to handle the representation of parameters specially.
|
Vector |
getDataTypesConvertedFrom(Class javaClass)
PUBLIC:
Return the list of Classes that can be converted to from the passed in javaClass.
|
Vector |
getDataTypesConvertedTo(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.
|
Map |
getPlatformOperators()
Return any platform-specific operators
|
Sequence |
getSequence(String seqName)
Get sequence corresponding to the name
|
int |
getSequencePreallocationSize() |
Map |
getSequences()
INTERNAL:
Returns a map of sequence names to Sequences (may be null).
|
Map |
getSequencesToWrite()
INTERNAL:
Used only for writing into XML or Java.
|
String |
getTableQualifier()
Return the qualifier for the table.
|
Timestamp |
getTimestampFromServer(AbstractSession session,
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(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(Map sequences)
INTERNAL:
Sets sequences - for XML support only
|
void |
setTableQualifier(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.
|
String |
toString() |
boolean |
usesPlatformDefaultSequence()
INTERNAL:
Indicates whether defaultSequence is the same as platform default sequence.
|
protected String tableQualifier
protected transient ConversionManager conversionManager
protected ValueReadQuery timestampQuery
protected transient Map platformOperators
protected Hashtable dataTypesConvertedFromAClass
protected Hashtable dataTypesConvertedToAClass
protected Sequence defaultSequence
protected Map sequences
protected void addOperator(ExpressionOperator operator)
public void appendParameter(Call call, Writer writer, Object parameter)
appendParameter
in interface Platform
public Object getCustomModifyValueForCall(Call call, Object value, DatabaseField field, boolean shouldBind)
getCustomModifyValueForCall
in interface Platform
public boolean shouldUseCustomModifyForCall(DatabaseField field)
shouldUseCustomModifyForCall
in interface Platform
public Object clone()
protected void sequencesAfterCloneCleanup()
public Object convertObject(Object sourceObject, Class javaClass) throws ConversionException
convertObject
in interface Platform
object
- - the object that must be convertedjavaClass
- - the class that the object must be converted to-
- ConversionException, all exceptions will be thrown as this type.ConversionException
public void copyInto(Platform platform)
public ConversionManager getConversionManager()
getConversionManager
in interface Platform
public void setConversionManager(ConversionManager conversionManager)
setConversionManager
in interface Platform
public ExpressionOperator getOperator(int selector)
public Map getPlatformOperators()
public int getSequencePreallocationSize()
public String getTableQualifier()
getTableQualifier
in interface Platform
public Timestamp getTimestampFromServer(AbstractSession session, String sessionName)
getTimestampFromServer
in interface Platform
public ValueReadQuery getTimestampQuery()
getTimestampQuery
in interface Platform
protected void initializePlatformOperators()
public boolean isAttunity()
isAttunity
in interface Platform
public boolean isCloudscape()
isCloudscape
in interface Platform
public boolean isInformix()
isInformix
in interface Platform
public boolean isPointBase()
isPointBase
in interface Platform
public boolean isSQLAnywhere()
isSQLAnywhere
in interface Platform
public boolean isSQLServer()
isSQLServer
in interface Platform
public boolean isTimesTen()
isTimesTen
in interface Platform
public boolean isPostgreSQL()
isPostgreSQL
in interface Platform
public void setTableQualifier(String qualifier)
setTableQualifier
in interface Platform
public void setTimestampQuery(ValueReadQuery tsQuery)
setTimestampQuery
in interface Platform
public Vector getDataTypesConvertedFrom(Class javaClass)
javaClass
- - the class that is converted frompublic Vector getDataTypesConvertedTo(Class javaClass)
javaClass
- - the class that is converted topublic Sequence getDefaultSequence()
getDefaultSequence
in interface Platform
public boolean hasDefaultSequence()
public void setDefaultSequence(Sequence sequence)
setDefaultSequence
in interface Platform
public void addSequence(Sequence sequence)
addSequence
in interface Platform
public Sequence getSequence(String seqName)
getSequence
in interface Platform
protected Sequence createPlatformDefaultSequence()
protected void createSequences()
public Sequence removeSequence(String seqName)
removeSequence
in interface Platform
public void removeAllSequences()
removeAllSequences
in interface Platform
public Map getSequences()
getSequences
in interface Platform
public Map getSequencesToWrite()
getSequencesToWrite
in interface Platform
public Sequence getDefaultSequenceToWrite()
getDefaultSequenceToWrite
in interface Platform
public void setSequences(Map sequences)
setSequences
in interface Platform
public boolean usesPlatformDefaultSequence()
usesPlatformDefaultSequence
in interface Platform
public void platformSpecificSequencingInitialization(DatabaseSession session)
platformSpecificSequencingInitialization
in interface Platform
Copyright © 2022. All rights reserved.