BatchSynchronizationProcedure

The BatchSynchronizationProcedure class is designed to compact and to clean implement a batch synchronization procedure giving the base behavior that a batch synchronization need to have

Author

N7ghtm4r3 - Tecknobit

Since

1.0.8

Parameters

<O>

The type of the owner entity

<D>

The type of the owned entity

<V>

The type of the support item used during the synchronization such JoinTableSyncBatchItem

Constructors

Link copied to clipboard
constructor(owner: O, ownedItems: Collection<D>, table: String, entityManager: EntityManager)
Constructor to init the sync procedure

Types

Link copied to clipboard
The CurrentDataCallback interface is useful to define a retriever used to retrieve the current data currently owned by the owner entity

Properties

Link copied to clipboard
private val _IN_CLAUSE_: String = " IN "
IN_CLAUSE in clause query part
Link copied to clipboard
val _VALUES_: String = " VALUES "
VALUES values query part
Link copied to clipboard
val _WHERE_: String = " WHERE "
WHERE where query part
Link copied to clipboard
batchQuery the manager of the batch query to execute
Link copied to clipboard
CLOSED_ROUND_BRACKET closed round bracket character
Link copied to clipboard
val COMMA: String = ","
COMMA comma character
Link copied to clipboard
currentDataCallback the callback used to retrieve the current data owned by the owner entity
Link copied to clipboard
val DELETE_FROM_: String = "DELETE FROM "
DELETE_FROM_ delete from query command
Link copied to clipboard
protected open var entityManager: EntityManager
entityManager entity manager helper
Link copied to clipboard
model the model to use during the synchronization procedure
Link copied to clipboard
OPENED_ROUND_BRACKET opened round bracket character
Link copied to clipboard
protected val ownedItems: Collection<D>
ownedItems the collection of the entities owned by the owner entity
Link copied to clipboard
protected val owner: O
owner the owner entity in the relationship
Link copied to clipboard
QUESTION_MARK question mark character
Link copied to clipboard
val SINGLE_QUOTE: String = "'"
SINGLE_QUOTE single quote character
Link copied to clipboard
protected val table: String
table the table where execute the synchronization

Functions

Link copied to clipboard
protected open fun batchDelete(table: String, values: Collection<out Any>, @NotNull columns: Array<@NotNull String>)
Method used to execute a batch delete of a single list of data simultaneously
Link copied to clipboard
protected open fun <V> batchInsert(    command: EquinoxItemsHelper.InsertCommand,     table: String,     batchQuery: EquinoxItemsHelper.BatchQuery<V>)
Method used to execute a batch insert of a list of data simultaneously
Link copied to clipboard
Method used to create the batch query used by the procedure
Link copied to clipboard
Method used to create the sync batch model used by the procedure
Link copied to clipboard
Method used to execute the batch synchronization
Link copied to clipboard
Method used to get the batchQuery
Link copied to clipboard
Method used to get the model
Link copied to clipboard
Method used to get the ownedItems
Link copied to clipboard
open fun getOwner(): O
Method used to get the owner
Link copied to clipboard
open fun getTable(): String
Method used to get the table
Link copied to clipboard
protected abstract fun loadDataList(rawData: Collection<D>): Collection<V>
Method used to loads and convert a raw collection of data to the collection used by the procedure
Link copied to clipboard
Method used to set the currentDataCallback instance
Link copied to clipboard
protected open fun <V> syncBatch(model: EquinoxItemsHelper.SyncBatchModel, table: String, batchQuery: EquinoxItemsHelper.BatchQuery<V>)
protected open fun <V> syncBatch(    model: EquinoxItemsHelper.SyncBatchModel,     command: EquinoxItemsHelper.InsertCommand,     table: String,     batchQuery: EquinoxItemsHelper.BatchQuery<V>)
Method used to execute a batch synchronization of a list of data simultaneously