Module org.eclipse.persistence.core
Class DatasourcePlatform
- java.lang.Object
-
- org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform
-
- All Implemented Interfaces:
Serializable,Cloneable,CorePlatform<ConversionManager>,Platform
- Direct Known Subclasses:
DatabasePlatform,EISPlatform,XMLPlatform
public class DatasourcePlatform extends Object implements Platform
DatasourcePlatform is private to TopLink. It encapsulates behavior specific to a datasource platform (eg. Oracle, Sybase, DB2, Attunity, MQSeries), and provides protocol for TopLink to access this behavior.- Since:
- OracleAS TopLink 10g (10.0.3)
- See Also:
DatabasePlatform,EISPlatform, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ConversionManagerconversionManagerAllow for conversion to be customized in the platform.protected Hashtable<Class<?>,List<Class<?>>>dataTypesConvertedFromAClassStore the list of Classes that can be converted to from the key.protected Hashtable<Class<?>,List<Class<?>>>dataTypesConvertedToAClassStore the list of Classes that can be converted from to the key.protected booleandefaultNativeSequenceToTableIf the native sequence type is not supported, if table sequencing should be used.protected booleandefaultSeqenceAtNextValueIf sequences should start at Next Valueprotected SequencedefaultSequenceStore default sequenceprotected StringendDelimiterprotected Map<Integer,ExpressionOperator>platformOperatorsOperators specific to this platformprotected Map<String,Sequence>sequencesStore map of sequence names to sequencesprotected ObjectsequencesLockEnsures that only one thread at a time can add/remove sequencesprotected StringstartDelimiterDelimiter to use for fields and tables using spaces or other special valuesprotected booleansupportsReturnGeneratedKeysThis property configures if the database platform will useStatement.getGeneratedKeys(), or a separate query, in order to obtain javax.persistence.GenerationType.IDENTITY generated values.protected StringtableQualifierSupporting name scopes in database by prefixing the table names with the table qualifier/creator.protected ValueReadQuerytimestampQueryStore the query use to query the current server time.protected ValueReadQueryuuidQueryStore the query use to query the current server UUID.
-
Constructor Summary
Constructors Constructor Description DatasourcePlatform()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddOperator(ExpressionOperator operator)voidaddSequence(Sequence sequence)Add sequence corresponding to the namevoidaddSequence(Sequence sequence, boolean isSessionConnected)Add sequence corresponding to the name.voidappendParameter(Call call, Writer writer, Object parameter)Add the parameter.DatasourceCallbuildNativeCall(String queryString)INTERNAL: Return the correct call type for the native query string.ValueReadQuerybuildSelectQueryForIdentity()INTERNAL: Returns query used to read back the value generated by Identity.ValueReadQuerybuildSelectQueryForIdentity(String seqName, Integer size)INTERNAL: Returns query used to read back the value generated by Identity.ValueReadQuerybuildSelectQueryForSequenceObject()INTERNAL: Returns query used to read value generated by sequence object (like Oracle sequence).ValueReadQuerybuildSelectQueryForSequenceObject(String qualifiedSeqName, Integer size)INTERNAL: Returns query used to read value generated by sequence object (like Oracle sequence).Objectclone()<T> TconvertObject(Object sourceObject, Class<T> javaClass)Convert the object to the appropriate type by invoking the appropriate ConversionManager methodvoidcopyInto(Platform platform)Copy the state into the new platform.ConnectionCustomizercreateConnectionCustomizer(Accessor accessor, AbstractSession session)INTERNAL:ExpressioncreateExpressionFor(DatabaseField field, Expression builder, String fieldClassificationClassName)INTERNAL: Override this method if the platform needs to use a custom function based on the DatabaseFieldprotected SequencecreatePlatformDefaultSequence()INTERNAL: Create platform-default SequenceConversionManagergetConversionManager()The platform hold its own instance of conversion manager to allow customization.ObjectgetCustomModifyValueForCall(Call call, Object value, DatabaseField field, boolean shouldBind)Allow for the platform to handle the representation of parameters specially.List<Class<?>>getDataTypesConvertedFrom(Class<?> javaClass)PUBLIC: Return the list of Classes that can be converted to from the passed in javaClass.List<Class<?>>getDataTypesConvertedTo(Class<?> javaClass)PUBLIC: Return the list of Classes that can be converted from to the passed in javaClass.booleangetDefaultNativeSequenceToTable()Return if the native sequence type is not supported, if table sequencing should be used.booleangetDefaultSeqenceAtNextValue()Return if the sequence generation should start at next value.SequencegetDefaultSequence()Get default sequenceSequencegetDefaultSequenceToWrite()INTERNAL: Used only for writing into XML or Java.StringgetDriverVersion()Return the driver version.StringgetEndDelimiter()Delimiter to use for fields and tables using spaces or other special values.intgetINClauseLimit()INTERNAL: Some database platforms have a limit for the number of parameters in an IN clause.ExpressionOperatorgetOperator(int selector)Return the operator for the operator constant defined in ExpressionOperator.Map<Integer,ExpressionOperator>getPlatformOperators()Return any platform-specific operatorsValueReadQuerygetSelectSequenceQuery()OBSOLETE: This method lazy initializes the select sequence number query.SequencegetSequence(String seqName)Get sequence corresponding to the nameintgetSequencePreallocationSize()Map<String,Sequence>getSequences()INTERNAL: Returns a map of sequence names to Sequences (may be null).Map<String,Sequence>getSequencesToWrite()INTERNAL: Used only for writing into XML or Java.StringgetStartDelimiter()Delimiter to use for fields and tables using spaces or other special values.StringgetTableQualifier()Return the qualifier for the table.TimestampgetTimestampFromServer(AbstractSession session, String sessionName)Answer the timestamp from the server.ValueReadQuerygetTimestampQuery()This method can be overridden by subclasses to return a query that will return the timestamp from the server.DataModifyQuerygetUpdateSequenceQuery()OBSOLETE: This method lazy initializes the update sequence number query.ValueReadQuerygetUUIDQuery()This method can be overridden by subclasses to return a query that will return the UUID from the server.booleanhasDefaultSequence()Get default sequencevoidinitialize()Allow the platform to initialize itself after login/init.voidinitializeDefaultQueries(DescriptorQueryManager queryManager, AbstractSession session)INTERNAL: Allow the platform to initialize the CRUD queries to defaults.protected voidinitializePlatformOperators()Initialize any platform-specific operatorsvoidinitIdentitySequences(Session session, String defaultIdentityGenerator)INTERNAL: Initialize platform specific identity sequences.booleanisAccess()booleanisAttunity()booleanisCloudscape()booleanisDB2()booleanisDB2Z()booleanisDBase()booleanisDerby()booleanisFirebird()booleanisH2()booleanisHANA()booleanisHSQL()booleanisInformix()booleanisMariaDB()booleanisMaxDB()booleanisMySQL()booleanisODBC()booleanisOracle()booleanisOracle12()booleanisOracle23()booleanisOracle9()booleanisPervasive()booleanisPointBase()booleanisPostgreSQL()booleanisSQLAnywhere()booleanisSQLServer()booleanisSybase()booleanisSymfoware()booleanisTimesTen()booleanisTimesTen7()voidremoveAllSequences()Remove all sequences, but the default one.voidremoveIdentitySequences(Session session, String defaultIdentityGenerator, Set<String> tableNames)INTERNAL: Remove platform specific identity sequences for specified tables.SequenceremoveSequence(String seqName)Remove sequence corresponding to name.protected voidsequencesAfterCloneCleanup()voidsetConversionManager(ConversionManager conversionManager)The platform hold its own instance of conversion manager to allow customization.voidsetDefaultNativeSequenceToTable(boolean defaultNativeSequenceToTable)Set if the native sequence type is not supported, if table sequencing should be used.voidsetDefaultSeqenceAtNextValue(boolean defaultSeqenceAtNextValue)Set if the sequence generation should start at next value.voidsetDefaultSequence(Sequence sequence)Set default sequence.voidsetEndDelimiter(String endDelimiter)Delimiter to use for fields and tables using spaces or other special values.voidsetSelectSequenceNumberQuery(ValueReadQuery seqQuery)OBSOLETE: Can override the default query for returning the sequence numbers.voidsetSequencePreallocationSize(int size)Set the number of sequence values to preallocate.voidsetSequences(Map<String,Sequence> sequences)INTERNAL: Sets sequences - for XML support onlyvoidsetStartDelimiter(String startDelimiter)Delimiter to use for fields and tables using spaces or other special values.voidsetSupportsReturnGeneratedKeys(boolean supportsReturnGeneratedKeys)Indicates whether the platform supports the use ofStatement.RETURN_GENERATED_KEYS.voidsetTableQualifier(String qualifier)Set the qualifier for the table.voidsetTimestampQuery(ValueReadQuery tsQuery)Can override the default query for returning a timestamp from the server.voidsetUpdateSequenceQuery(DataModifyQuery updateSequenceNumberQuery)This method sets the update sequence number query.voidsetUUIDQuery(ValueReadQuery uuidQuery)Can override the default query for returning a UUID from the server.booleanshouldNativeSequenceUseTransaction()INTERNAL: Indicates whether a separate transaction is required for NativeSequence.booleanshouldPrepare(DatabaseQuery query)Allows query prepare to be disable in the platform.booleanshouldSelectDistinctIncludeOrderBy()Return if the database requires the ORDER BY fields to be part of the select clause.booleanshouldSelectIncludeOrderBy()Return if the database requires the ORDER BY fields to be part of the select clause.booleanshouldUseCustomModifyForCall(DatabaseField field)Used by SQLCall.appendModify(..) If the field should be passed to customModifyInDatabaseCall, retun true, otherwise false.booleansupportsIdentity()INTERNAL: Indicates whether the platform supports identity.booleansupportsNativeSequenceNumbers()booleansupportsReturnGeneratedKeys()Indicates whether the platform supports the use ofStatement.RETURN_GENERATED_KEYS.booleansupportsSequenceObjects()INTERNAL: Indicates whether the platform supports sequence objects.StringtoString()booleanusesPlatformDefaultSequence()INTERNAL: Indicates whether defaultSequence is the same as platform default sequence.-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.persistence.internal.databaseaccess.Platform
connectionProperties
-
-
-
-
Field Detail
-
tableQualifier
protected String tableQualifier
Supporting name scopes in database by prefixing the table names with the table qualifier/creator.
-
conversionManager
protected transient ConversionManager conversionManager
Allow for conversion to be customized in the platform.
-
timestampQuery
protected ValueReadQuery timestampQuery
Store the query use to query the current server time.
-
uuidQuery
protected ValueReadQuery uuidQuery
Store the query use to query the current server UUID.
-
platformOperators
protected transient Map<Integer,ExpressionOperator> platformOperators
Operators specific to this platform
-
dataTypesConvertedFromAClass
protected Hashtable<Class<?>,List<Class<?>>> dataTypesConvertedFromAClass
Store the list of Classes that can be converted to from the key.
-
dataTypesConvertedToAClass
protected Hashtable<Class<?>,List<Class<?>>> dataTypesConvertedToAClass
Store the list of Classes that can be converted from to the key.
-
defaultSequence
protected Sequence defaultSequence
Store default sequence
-
startDelimiter
protected String startDelimiter
Delimiter to use for fields and tables using spaces or other special values
-
endDelimiter
protected String endDelimiter
-
sequencesLock
protected Object sequencesLock
Ensures that only one thread at a time can add/remove sequences
-
defaultNativeSequenceToTable
protected boolean defaultNativeSequenceToTable
If the native sequence type is not supported, if table sequencing should be used.
-
defaultSeqenceAtNextValue
protected boolean defaultSeqenceAtNextValue
If sequences should start at Next Value
-
supportsReturnGeneratedKeys
protected boolean supportsReturnGeneratedKeys
This property configures if the database platform will useStatement.getGeneratedKeys(), or a separate query, in order to obtain javax.persistence.GenerationType.IDENTITY generated values.Allowed Values:
- "
true" - IDENTITY generated values will be obtained withStatement.getGeneratedKeys() - "
false" (DEFAULT) - IDENTITY generated values will be obtained with a separate querybuildSelectQueryForIdentity()
See:
buildSelectQueryForIdentity()will be disabled if this property is enabled
- "
-
-
Method Detail
-
getDefaultNativeSequenceToTable
public boolean getDefaultNativeSequenceToTable()
Return if the native sequence type is not supported, if table sequencing should be used.
-
setDefaultNativeSequenceToTable
public void setDefaultNativeSequenceToTable(boolean defaultNativeSequenceToTable)
Set if the native sequence type is not supported, if table sequencing should be used.
-
getDefaultSeqenceAtNextValue
public boolean getDefaultSeqenceAtNextValue()
Return if the sequence generation should start at next value.
-
setDefaultSeqenceAtNextValue
public void setDefaultSeqenceAtNextValue(boolean defaultSeqenceAtNextValue)
Set if the sequence generation should start at next value.
-
addOperator
protected void addOperator(ExpressionOperator operator)
-
appendParameter
public void appendParameter(Call call, Writer writer, Object parameter)
Add the parameter. Convert the parameter to a string and write it.- Specified by:
appendParameterin interfacePlatform
-
getCustomModifyValueForCall
public Object getCustomModifyValueForCall(Call call, Object value, DatabaseField field, boolean shouldBind)
Allow for the platform to handle the representation of parameters specially.- Specified by:
getCustomModifyValueForCallin interfacePlatform
-
shouldUseCustomModifyForCall
public boolean shouldUseCustomModifyForCall(DatabaseField field)
Used by SQLCall.appendModify(..) If the field should be passed to customModifyInDatabaseCall, retun true, otherwise false. Methods shouldCustomModifyInDatabaseCall and customModifyInDatabaseCall should be kept in sync: shouldCustomModifyInDatabaseCall should return true if and only if the field is handled by customModifyInDatabaseCall.- Specified by:
shouldUseCustomModifyForCallin interfacePlatform
-
clone
public Object clone()
-
sequencesAfterCloneCleanup
protected void sequencesAfterCloneCleanup()
-
convertObject
public <T> T convertObject(Object sourceObject, Class<T> javaClass) throws ConversionException
Convert the object to the appropriate type by invoking the appropriate ConversionManager method- Specified by:
convertObjectin interfaceCorePlatform<ConversionManager>- Specified by:
convertObjectin interfacePlatform- Parameters:
sourceObject- the object that must be convertedjavaClass- the class that the object must be converted to- Returns:
- the newly converted object
- Throws:
ConversionException- all exceptions will be thrown as this type.
-
copyInto
public void copyInto(Platform platform)
Copy the state into the new platform.
-
getConversionManager
public ConversionManager getConversionManager()
The platform hold its own instance of conversion manager to allow customization.- Specified by:
getConversionManagerin interfaceCorePlatform<ConversionManager>- Specified by:
getConversionManagerin interfacePlatform
-
setConversionManager
public void setConversionManager(ConversionManager conversionManager)
The platform hold its own instance of conversion manager to allow customization.- Specified by:
setConversionManagerin interfacePlatform
-
getDriverVersion
public String getDriverVersion()
Return the driver version.- Specified by:
getDriverVersionin interfacePlatform
-
getEndDelimiter
public String getEndDelimiter()
Delimiter to use for fields and tables using spaces or other special values. Some databases use different delimiters for the beginning and end of the value. This delimiter indicates the end of the value.- Specified by:
getEndDelimiterin interfacePlatform
-
setEndDelimiter
public void setEndDelimiter(String endDelimiter)
Delimiter to use for fields and tables using spaces or other special values. Some databases use different delimiters for the beginning and end of the value. This delimiter indicates the end of the value.
-
getOperator
public ExpressionOperator getOperator(int selector)
Return the operator for the operator constant defined in ExpressionOperator.
-
getPlatformOperators
public Map<Integer,ExpressionOperator> getPlatformOperators()
Return any platform-specific operators
-
getSelectSequenceQuery
public ValueReadQuery getSelectSequenceQuery()
OBSOLETE: This method lazy initializes the select sequence number query. It allows for other queries to be used instead of the default one.
-
getSequencePreallocationSize
public int getSequencePreallocationSize()
-
getStartDelimiter
public String getStartDelimiter()
Delimiter to use for fields and tables using spaces or other special values. Some databases use different delimiters for the beginning and end of the value. This delimiter indicates the start of the value.- Specified by:
getStartDelimiterin interfacePlatform
-
setStartDelimiter
public void setStartDelimiter(String startDelimiter)
Delimiter to use for fields and tables using spaces or other special values. Some databases use different delimiters for the beginning and end of the value. This delimiter indicates the start of the value.
-
getTableQualifier
public String getTableQualifier()
Return the qualifier for the table. Required by some databases such as Oracle and DB2- Specified by:
getTableQualifierin interfacePlatform
-
getTimestampFromServer
public Timestamp getTimestampFromServer(AbstractSession session, String sessionName)
Answer the timestamp from the server.- Specified by:
getTimestampFromServerin interfacePlatform
-
getTimestampQuery
public ValueReadQuery getTimestampQuery()
This method can be overridden by subclasses to return a query that will return the timestamp from the server. return null if the time should be the local time.- Specified by:
getTimestampQueryin interfacePlatform
-
getUUIDQuery
public ValueReadQuery getUUIDQuery()
This method can be overridden by subclasses to return a query that will return the UUID from the server. return null if UUID can't be generated by platform.- Specified by:
getUUIDQueryin interfacePlatform
-
getUpdateSequenceQuery
public DataModifyQuery getUpdateSequenceQuery()
OBSOLETE: This method lazy initializes the update sequence number query. It allows for other queries to be used instead of the default one.
-
initializePlatformOperators
protected void initializePlatformOperators()
Initialize any platform-specific operators
-
initializeDefaultQueries
public void initializeDefaultQueries(DescriptorQueryManager queryManager, AbstractSession session)
INTERNAL: Allow the platform to initialize the CRUD queries to defaults. This is mainly used by EIS platforms, but could be used by relational ones for special behavior.
-
isAttunity
public boolean isAttunity()
- Specified by:
isAttunityin interfacePlatform
-
isCloudscape
public boolean isCloudscape()
- Specified by:
isCloudscapein interfacePlatform
-
isInformix
public boolean isInformix()
- Specified by:
isInformixin interfacePlatform
-
isOracle12
public boolean isOracle12()
- Specified by:
isOracle12in interfacePlatform
-
isOracle23
public boolean isOracle23()
- Specified by:
isOracle23in interfacePlatform
-
isPervasive
public boolean isPervasive()
-
isPostgreSQL
public boolean isPostgreSQL()
- Specified by:
isPostgreSQLin interfacePlatform
-
isPointBase
public boolean isPointBase()
- Specified by:
isPointBasein interfacePlatform
-
isSQLAnywhere
public boolean isSQLAnywhere()
- Specified by:
isSQLAnywherein interfacePlatform
-
isFirebird
public boolean isFirebird()
-
isSQLServer
public boolean isSQLServer()
- Specified by:
isSQLServerin interfacePlatform
-
isSymfoware
public boolean isSymfoware()
- Specified by:
isSymfowarein interfacePlatform
-
isTimesTen
public boolean isTimesTen()
- Specified by:
isTimesTenin interfacePlatform
-
isTimesTen7
public boolean isTimesTen7()
- Specified by:
isTimesTen7in interfacePlatform
-
initialize
public void initialize()
Allow the platform to initialize itself after login/init.- Specified by:
initializein interfacePlatform
-
setSelectSequenceNumberQuery
public void setSelectSequenceNumberQuery(ValueReadQuery seqQuery)
OBSOLETE: Can override the default query for returning the sequence numbers. This query must be a valid query that has one parameter which is the sequence name.
-
setSequencePreallocationSize
public void setSequencePreallocationSize(int size)
Set the number of sequence values to preallocate. Preallocating sequence values can greatly improve insert performance.
-
setTableQualifier
public void setTableQualifier(String qualifier)
Set the qualifier for the table. Required by some databases such as Oracle and DB2- Specified by:
setTableQualifierin interfacePlatform
-
setTimestampQuery
public void setTimestampQuery(ValueReadQuery tsQuery)
Can override the default query for returning a timestamp from the server. See: getTimestampFromServer- Specified by:
setTimestampQueryin interfacePlatform
-
setUUIDQuery
public void setUUIDQuery(ValueReadQuery uuidQuery)
Can override the default query for returning a UUID from the server.- Specified by:
setUUIDQueryin interfacePlatform
-
setUpdateSequenceQuery
public void setUpdateSequenceQuery(DataModifyQuery updateSequenceNumberQuery)
This method sets the update sequence number query. It allows for other queries to be used instead of the default one.
-
getDataTypesConvertedFrom
public List<Class<?>> getDataTypesConvertedFrom(Class<?> javaClass)
PUBLIC: Return the list of Classes that can be converted to from the passed in javaClass.- Parameters:
javaClass- - the class that is converted from- Returns:
- - a vector of classes
-
getDataTypesConvertedTo
public List<Class<?>> getDataTypesConvertedTo(Class<?> javaClass)
PUBLIC: Return the list of Classes that can be converted from to the passed in javaClass.- Parameters:
javaClass- - the class that is converted to- Returns:
- - a vector of classes
-
getDefaultSequence
public Sequence getDefaultSequence()
Get default sequence- Specified by:
getDefaultSequencein interfacePlatform
-
hasDefaultSequence
public boolean hasDefaultSequence()
Get default sequence
-
setDefaultSequence
public void setDefaultSequence(Sequence sequence)
Set default sequence. In case the passed sequence is of type DefaultSequence - use platformDefaultSequence with name and size of the passed sequence.- Specified by:
setDefaultSequencein interfacePlatform
-
addSequence
public void addSequence(Sequence sequence)
Add sequence corresponding to the name- Specified by:
addSequencein interfacePlatform
-
setSupportsReturnGeneratedKeys
public void setSupportsReturnGeneratedKeys(boolean supportsReturnGeneratedKeys)
Indicates whether the platform supports the use ofStatement.RETURN_GENERATED_KEYS. If supported, IDENTITY values will be obtained throughStatement.getGeneratedKeys()and will replace usage ofbuildSelectQueryForIdentity()
-
addSequence
public void addSequence(Sequence sequence, boolean isSessionConnected)
Add sequence corresponding to the name. Use this method with isSessionConnected parameter set to true to add a sequence to connected session. If the session is connected then the sequence is added only if there is no sequence with the same name already in use.- Specified by:
addSequencein interfacePlatform
-
getSequence
public Sequence getSequence(String seqName)
Get sequence corresponding to the name- Specified by:
getSequencein interfacePlatform
-
createPlatformDefaultSequence
protected Sequence createPlatformDefaultSequence()
INTERNAL: Create platform-default Sequence
-
removeSequence
public Sequence removeSequence(String seqName)
Remove sequence corresponding to name. Doesn't remove default sequence.- Specified by:
removeSequencein interfacePlatform
-
removeAllSequences
public void removeAllSequences()
Remove all sequences, but the default one.- Specified by:
removeAllSequencesin interfacePlatform
-
getSequences
public Map<String,Sequence> getSequences()
INTERNAL: Returns a map of sequence names to Sequences (may be null).- Specified by:
getSequencesin interfacePlatform
-
getSequencesToWrite
public Map<String,Sequence> getSequencesToWrite()
INTERNAL: Used only for writing into XML or Java.- Specified by:
getSequencesToWritein interfacePlatform
-
getDefaultSequenceToWrite
public Sequence getDefaultSequenceToWrite()
INTERNAL: Used only for writing into XML or Java.- Specified by:
getDefaultSequenceToWritein interfacePlatform
-
setSequences
public void setSequences(Map<String,Sequence> sequences)
INTERNAL: Sets sequences - for XML support only- Specified by:
setSequencesin interfacePlatform
-
usesPlatformDefaultSequence
public boolean usesPlatformDefaultSequence()
INTERNAL: Indicates whether defaultSequence is the same as platform default sequence.- Specified by:
usesPlatformDefaultSequencein interfacePlatform
-
createConnectionCustomizer
public ConnectionCustomizer createConnectionCustomizer(Accessor accessor, AbstractSession session)
INTERNAL:
-
shouldPrepare
public boolean shouldPrepare(DatabaseQuery query)
Allows query prepare to be disable in the platform. This is required for some EIS platforms, that cannot prepare the call.
-
shouldSelectIncludeOrderBy
public boolean shouldSelectIncludeOrderBy()
Return if the database requires the ORDER BY fields to be part of the select clause.
-
shouldSelectDistinctIncludeOrderBy
public boolean shouldSelectDistinctIncludeOrderBy()
Return if the database requires the ORDER BY fields to be part of the select clause.
-
shouldNativeSequenceUseTransaction
public boolean shouldNativeSequenceUseTransaction()
INTERNAL: Indicates whether a separate transaction is required for NativeSequence. This method is to be used *ONLY* by sequencing classes
-
supportsIdentity
public boolean supportsIdentity()
INTERNAL: Indicates whether the platform supports identity. This method is to be used *ONLY* by sequencing classes
-
supportsNativeSequenceNumbers
public boolean supportsNativeSequenceNumbers()
-
supportsSequenceObjects
public boolean supportsSequenceObjects()
INTERNAL: Indicates whether the platform supports sequence objects. This method is to be used *ONLY* by sequencing classes
-
supportsReturnGeneratedKeys
public boolean supportsReturnGeneratedKeys()
Indicates whether the platform supports the use ofStatement.RETURN_GENERATED_KEYS. If supported, IDENTITY values will be obtained throughStatement.getGeneratedKeys()and will replace usage ofbuildSelectQueryForIdentity()
-
buildSelectQueryForSequenceObject
public ValueReadQuery buildSelectQueryForSequenceObject()
INTERNAL: Returns query used to read value generated by sequence object (like Oracle sequence). This method is called when sequence object NativeSequence is connected, the returned query used until the sequence is disconnected. If the platform supportsSequenceObjects then (at least) one of buildSelectQueryForSequenceObject methods should return non-null query.
-
buildSelectQueryForSequenceObject
public ValueReadQuery buildSelectQueryForSequenceObject(String qualifiedSeqName, Integer size)
INTERNAL: Returns query used to read value generated by sequence object (like Oracle sequence). In case the other version of this method (taking no parameters) returns null, this method is called every time sequence object NativeSequence reads. If the platform supportsSequenceObjects then (at least) one of buildSelectQueryForSequenceObject methods should return non-null query.
-
buildSelectQueryForIdentity
public ValueReadQuery buildSelectQueryForIdentity()
INTERNAL: Returns query used to read back the value generated by Identity. This method is called when identity NativeSequence is connected, the returned query used until the sequence is disconnected. If the platform supportsIdentity then (at least) one of buildSelectQueryForIdentity methods should return non-null query.Alternatively, if the platform supports
Statement.getGeneratedKeys(), seesupportsReturnGeneratedKeys()
-
buildSelectQueryForIdentity
public ValueReadQuery buildSelectQueryForIdentity(String seqName, Integer size)
INTERNAL: Returns query used to read back the value generated by Identity. In case the other version of this method (taking no parameters) returns null, this method is called every time identity NativeSequence reads. If the platform supportsIdentity then (at least) one of buildSelectQueryForIdentity methods should return non-null query.
-
buildNativeCall
public DatasourceCall buildNativeCall(String queryString)
INTERNAL: Return the correct call type for the native query string. This allows EIS platforms to use different types of native calls.
-
initIdentitySequences
public void initIdentitySequences(Session session, String defaultIdentityGenerator)
INTERNAL: Initialize platform specific identity sequences.- Specified by:
initIdentitySequencesin interfacePlatform- Parameters:
session- Active database session (in connected state).defaultIdentityGenerator- Default identity generator sequence name.- Since:
- 2.7
-
removeIdentitySequences
public void removeIdentitySequences(Session session, String defaultIdentityGenerator, Set<String> tableNames)
INTERNAL: Remove platform specific identity sequences for specified tables. Default identity sequences are restored.- Specified by:
removeIdentitySequencesin interfacePlatform- Parameters:
session- Active database session (in connected state).defaultIdentityGenerator- Default identity generator sequence name.tableNames- Set of table names to check for identity sequence removal.- Since:
- 2.7
-
createExpressionFor
public Expression createExpressionFor(DatabaseField field, Expression builder, String fieldClassificationClassName)
INTERNAL: Override this method if the platform needs to use a custom function based on the DatabaseField- Returns:
- An expression for the given field set equal to a parameter matching the field
-
getINClauseLimit
public int getINClauseLimit()
INTERNAL: Some database platforms have a limit for the number of parameters in an IN clause.
-
-