0f0da297ccb510a07a89371d84670e086d3eafcd | Author: AndrewFrom <andrew.from@target.com>
| 2019-11-06 14:37:29-06:00
Add BoundStatement ReturnType as a return type for Create, Update, and Delete operations
Motivation:
In the 3.x driver the object-mapper had Mapper.saveQuery(entity) and
Mapper.deleteQuery(id) which returned a BoundStatement that you could
later execute. This was useful for creating a list of BoundStatement
that would be added to a LOGGED Batch statement for atomically saving
data that is saved across several denormalized tables (to support
different query patterns on the same data).
While the current code sort of enables that with the @SetEntity, it
however lacks a lot of the features that the other DAO methods have,
for instance setting a TTL, custom IF and WHERE clauses that are
are supported by the @Insert, @Update, and @Delete methods. And not
all of these features may be supportable on this more generic implemenation.
Modifcations:
Added a new DaoReturnType.BOUND_STATEMENT that is practically identical to
to the existing DaoReturnType. Since it just returns the BoundStatment
instead of executing it.
Result:
For @Insert, @Update, @Delete, and @Query DAO methods BoundStatement is
now a new supported return type. This is an additive change to the API
of the Mapper so it is non-breaking.