ptupitsyn commented on code in PR #5836:
URL: https://github.com/apache/ignite-3/pull/5836#discussion_r2707701684


##########
modules/api/src/main/java/org/apache/ignite/table/RecordView.java:
##########
@@ -211,16 +402,50 @@ public interface RecordView<R> extends 
DataStreamerTarget<R>, CriteriaQuerySourc
      */
     boolean replace(@Nullable Transaction tx, R rec);
 
+    /**
+     * Replaces an existing record associated with the same key column values 
as the given record.
+     *
+     * @param rec Record to replace with. The record cannot be {@code null}.
+     * @return {@code True} if a record was found and replaced successfully, 
{@code false} otherwise.
+     */
+    default boolean replace(R rec) {
+        return replace(null, rec);
+    }
+
     /**
      * Replaces an expected record in the table with the given new one.
+     * Deprecated: use {@link #replaceExact(Transaction, Object, Object)} 
instead.
      *
      * @param tx     Transaction or {@code null} for implicit transaction.
      * @param oldRec Record to replace. The record cannot be {@code null}.
      * @param newRec Record to replace with. The record cannot be {@code null}.
      * @return {@code True} if a record was replaced successfully, {@code 
false} otherwise.
      */
+    @Deprecated(forRemoval = true)
     boolean replace(@Nullable Transaction tx, R oldRec, R newRec);
 
+    /**
+     * Replaces an expected record in the table with the given new one.
+     *
+     * @param oldRec Record to replace. The record cannot be {@code null}.
+     * @param newRec Record to replace with. The record cannot be {@code null}.
+     * @return {@code True} if a record was replaced successfully, {@code 
false} otherwise.
+     */
+    default boolean replaceExact(@Nullable Transaction tx, R oldRec, R newRec) 
{
+        return replace(null, oldRec, newRec);

Review Comment:
   ```suggestion
           return replace(tx, oldRec, newRec);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to