Upsert class
Marks a method as an upsert method.
An upsert tries to insert the entity. When the insertion fails because of a unique constraint conflict (e.g. the primary key already exists), the existing row gets updated instead.
The method parameters have to be entities or lists of entities. Multiple parameters are upserted in a single transaction.
Upsert methods can return a Future of void, int or List<int>.
The returned ids are the row ids of inserted entities or -1 for entities
that got updated. Returning ids is only supported for methods with a single
parameter: int for a single entity and List<int> for a list of entities.
When entity is set, the parameters can be partial entities, i.e. classes containing a subset of the columns of the target entity. Only the columns of the partial entity get inserted or updated.
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited