SparkDataItemPersistor

An object that can persist data to the database.

By default, the persistor will perform a selective update based on the changed data, without checking the version

persist

signature persist()

returns SparkDataResult

Persists the state of the document to the database using the supplied strategies.

This method will return false if either the conditional check, or the version check fail

withAtomicIncrements

signature withAtomicIncrements()

returns SparkDataItemPersistor

If set, only the changes that have been made to this document are persisted.

Additionally, any numeric changes will be atomically incremented or decremented based on the original value

This method will turn off 'withOverwrite' if it's been previously specified

withConditionCheck

signature withConditionCheck(SparkDataCondition condition)

returns SparkDataItemPersistor

If supplied, the conditions will be used to do a conditional update

withErrorOnTypeConversion

signature withErrorOnTypeConversion()

returns SparkDataItemPersistor

If set, when the document is serialised for persistance, if an unsupported data type is found, an exception will be thrown

withOverwrite

signature withOverwrite()

returns SparkDataItemPersistor

If set, all fields in the document are persisted, even if they have not been changed, potentially overwriting changes made by other updates.

This method will turn off 'withAtomicIncrements' if it's been previously specified.

withVersionCheck

signature withVersionCheck()

returns SparkDataItemPersistor

If set, the document's version number will be used to do a conditional update.

If the version number in the DB is different to the version number in this instance, the persist call will return false

Did this page help you? Please enter your feedback below. For questions about using this part of the platform, please contact support here