Qore jni Module  1.0.1
Upsert Strategy Codes

Variables

static int org.qore.lang.sqlutil.AbstractTable.UpsertInsertFirst = 1
 Upsert option: insert first, if the insert fails, then update. More...
 
static int org.qore.lang.sqlutil.AbstractTable.UpsertUpdateFirst = 2
 Upsert option: update first, if the update fails, then insert. More...
 
static int org.qore.lang.sqlutil.AbstractTable.UpsertSelectFirst = 3
 Upsert option: select first, if the row is unchanged, do nothing, if it doesn't exist, insert, otherwise update. More...
 
static int org.qore.lang.sqlutil.AbstractTable.UpsertAuto = 4
 Upsert option: if the target table is empty, use UpsertInsertFirst, otherwise use UpsertUpdateFirst. More...
 
static int org.qore.lang.sqlutil.AbstractTable.UpsertInsertOnly = 5
 Upsert option: insert if the row does not exist, otherwise ignore. More...
 
static int org.qore.lang.sqlutil.AbstractTable.UpsertUpdateOnly = 6
 Upsert option: update if the row exists, otherwise ignore. More...
 
static final Map< Integer, String > org.qore.lang.sqlutil.AbstractTable.UpsertStrategyMap
 hash mapping upsert strategy codes to a text description More...
 
static final Map< String, Integer > org.qore.lang.sqlutil.AbstractTable.UpsertStrategyDescriptionMap
 hash mapping upsert strategy descriptions to upsert strategy codes More...
 

Detailed Description

These options are used with:

to specify the upsert strategy when synchronizing table data

Variable Documentation

◆ UpsertAuto

int org.qore.lang.sqlutil.AbstractTable.UpsertAuto = 4
static

Upsert option: if the target table is empty, use UpsertInsertFirst, otherwise use UpsertUpdateFirst.

With this upsert strategy, the following row result codes are possible:

◆ UpsertInsertFirst

int org.qore.lang.sqlutil.AbstractTable.UpsertInsertFirst = 1
static

Upsert option: insert first, if the insert fails, then update.

with this option an insert is attempted, and if it fails due to a duplicate row, then an update is made unconditionally; with this upsert strategy, the following row result codes are possible:

◆ UpsertInsertOnly

int org.qore.lang.sqlutil.AbstractTable.UpsertInsertOnly = 5
static

Upsert option: insert if the row does not exist, otherwise ignore.

With this upsert strategy, the following row result codes are possible:

◆ UpsertSelectFirst

int org.qore.lang.sqlutil.AbstractTable.UpsertSelectFirst = 3
static

Upsert option: select first, if the row is unchanged, do nothing, if it doesn't exist, insert, otherwise update.

with this option the row is selected, if it doesn't exist, an insert is made, and an update is made only if the values are different; with this upsert strategy, the following row result codes are possible:

◆ UpsertStrategyDescriptionMap

final Map<String, Integer> org.qore.lang.sqlutil.AbstractTable.UpsertStrategyDescriptionMap
static
Initial value:
= Collections.unmodifiableMap(new HashMap<String, Integer>() {
{
put("UpsertInsertFirst", UpsertInsertFirst);
put("UpsertUpdateFirst", UpsertUpdateFirst);
put("UpsertSelectFirst", UpsertSelectFirst);
put("UpsertAuto", UpsertAuto);
put("UpsertInsertOnly", UpsertInsertOnly);
put("UpsertUpdateOnly", UpsertUpdateOnly);
}
})

hash mapping upsert strategy descriptions to upsert strategy codes

See also
UpsertStrategyMap for a reverse mapping

◆ UpsertStrategyMap

final Map<Integer, String> org.qore.lang.sqlutil.AbstractTable.UpsertStrategyMap
static
Initial value:
= Collections.unmodifiableMap(new HashMap<Integer, String>() {
{
put(UpsertInsertFirst, "UpsertInsertFirst");
put(UpsertUpdateFirst, "UpsertUpdateFirst");
put(UpsertSelectFirst, "UpsertSelectFirst");
put(UpsertAuto, "UpsertAuto");
put(UpsertInsertOnly, "UpsertInsertOnly");
put(UpsertUpdateOnly, "UpsertUpdateOnly");
}
})

hash mapping upsert strategy codes to a text description

See also
UpsertStrategyDescriptionMap for a reverse mapping

◆ UpsertUpdateFirst

int org.qore.lang.sqlutil.AbstractTable.UpsertUpdateFirst = 2
static

Upsert option: update first, if the update fails, then insert.

with this option an update is attempted, and if it fails due to a missing row, then an insert is performed; with this upsert strategy, the following row result codes are possible:

◆ UpsertUpdateOnly

int org.qore.lang.sqlutil.AbstractTable.UpsertUpdateOnly = 6
static

Upsert option: update if the row exists, otherwise ignore.

With this upsert strategy, the following row result codes are possible: