public abstract class OrmUtils
extends java.lang.Object
Constructor and Description |
---|
OrmUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
dropUniqueIndexConflicts(RecordBuffer buffer,
Persistence p,
int multiplexID)
Given a TEMP-TABLE record, this method drops all records from the table that are in conflict with the
record stored in the
buffer so that at the next flush (insert) it is guaranteed there will be
no unique validation issues. |
static java.lang.Object |
getField(BaseRecord record,
int index)
Get the field on the given index, from the specified record.
|
static boolean |
setAllFields(BaseRecord src,
BaseRecord dst)
Sets all fields on a record based on a provided record.
|
static void |
setField(BaseRecord record,
int index,
java.lang.Object datum)
Sets a field on a record.
|
public static void dropUniqueIndexConflicts(RecordBuffer buffer, Persistence p, int multiplexID) throws PersistenceException
buffer
so that at the next flush (insert) it is guaranteed there will be
no unique validation issues.
The method works by executing a series of n
DELETE statements, each one for a specific unique
index of the record's table.
Note: the method deletes all records for a specified multiplex
, INCLUDING the record in the
buffer, if it was already saved;
if multiple existing records conflict with the one stored in buffer, all of them are dropped.
buffer
- The buffer that stores the record.p
- The persistence to be used when executing DELETE SQL statements.multiplexID
- The temp-table multiplexer.PersistenceException
- when a problem is encountered during the process.public static void setField(BaseRecord record, int index, java.lang.Object datum)
index
location
in the data
array of the record.record
- The BaseRecord
to be changed.index
- The absolute index of the property (including extent offset, if the case).datum
- The value to be set (plain value, not wrapped in BDT).public static boolean setAllFields(BaseRecord src, BaseRecord dst)
data
array of the record.src
- The source record from which the data will be copied.dst
- The destination record to which the data will be copied.public static java.lang.Object getField(BaseRecord record, int index)
record
- The record instance.index
- The absolute index of the property (including extent offset, if the case).