Interface RecordView<R>

Type Parameters:
R - Mapped record type.
All Superinterfaces:
AutoCloseable, ContinuousQuerySource<R>, CriteriaQuerySource<R>, DataStreamerTarget<R>

public interface RecordView<R> extends DataStreamerTarget<R>, CriteriaQuerySource<R>, ContinuousQuerySource<R>, AutoCloseable
Table view interface provides methods to access table records.
See Also:
  • Method Details

    • get

      R get(@Nullable @Nullable Transaction tx, R keyRec)
      Gets a record with the same key column values as the given one from a table.
      Parameters:
      tx - Transaction or null for implicit transaction.
      keyRec - Record with the key columns set. The record cannot be null.
      Returns:
      Record with all columns filled from the table.
    • get

      default R get(R keyRec)
      Gets a record with the same key column values as the given one from a table.
      Parameters:
      keyRec - Record with the key columns set. The record cannot be null.
      Returns:
      Record with all columns filled from the table.
    • getAsync

      CompletableFuture<R> getAsync(@Nullable @Nullable Transaction tx, R keyRec)
      Asynchronously gets a record with the same key column values as the given one from a table.
      Parameters:
      tx - Transaction or null for implicit transaction.
      keyRec - Record with the key columns set. The record cannot be null.
      Returns:
      Future that represents the pending completion of the operation.
    • getAsync

      default CompletableFuture<R> getAsync(R keyRec)
      Asynchronously gets a record with the same key column values as the given one from a table.
      Parameters:
      keyRec - Record with the key columns set. The record cannot be null.
      Returns:
      Future that represents the pending completion of the operation.
    • getAll

      List<R> getAll(@Nullable @Nullable Transaction tx, Collection<R> keyRecs)
      Gets records from a table.
      Parameters:
      tx - Transaction or null for implicit transaction.
      keyRecs - Records with key columns set. The records cannot be null.
      Returns:
      Records with all columns filled from the table. The order of collection elements is guaranteed to be the same as the order of keyRecs. If a record does not exist, the element at the corresponding index of the resulting collection is null.
    • getAll

      default List<R> getAll(Collection<R> keyRecs)
      Gets records from a table.
      Parameters:
      keyRecs - Records with key columns set. The records cannot be null.
      Returns:
      Records with all columns filled from the table. The order of collection elements is guaranteed to be the same as the order of keyRecs. If a record does not exist, the element at the corresponding index of the resulting collection is null.
    • getAllAsync

      CompletableFuture<List<R>> getAllAsync(@Nullable @Nullable Transaction tx, Collection<R> keyRecs)
      Asynchronously gets records from a table.
      Parameters:
      tx - Transaction or null for implicit transaction.
      keyRecs - Records with the key columns set. The records cannot be null.
      Returns:
      Future that will return records with all columns filled from the table. The order of collection elements is guaranteed to be the same as the order of keyRecs. If a record does not exist, the element at the corresponding index of the resulting collection is null.
    • getAllAsync

      default CompletableFuture<List<R>> getAllAsync(Collection<R> keyRecs)
      Asynchronously gets records from a table.
      Parameters:
      keyRecs - Records with the key columns set. The records cannot be null.
      Returns:
      Future that will return records with all columns filled from the table. The order of collection elements is guaranteed to be the same as the order of keyRecs. If a record does not exist, the element at the corresponding index of the resulting collection is null.
    • contains

      boolean contains(@Nullable @Nullable Transaction tx, R keyRec)
      Determines whether a table contains an entry for the specified key.
      Parameters:
      tx - Transaction or null for implicit transaction.
      keyRec - A record with key columns set. The key cannot be null.
      Returns:
      True if a value exists for every specified key, false otherwise.
      Throws:
      MarshallerException - if the key doesn't match the schema.
    • contains

      default boolean contains(R keyRec)
      Determines whether a table contains an entry for the specified key.
      Parameters:
      keyRec - A record with key columns set. The key cannot be null.
      Returns:
      True if a value exists for every specified key, false otherwise.
      Throws:
      MarshallerException - if the key doesn't match the schema.
    • containsAsync

      CompletableFuture<Boolean> containsAsync(@Nullable @Nullable Transaction tx, R keyRec)
      Determines whether a table contains an entry for the specified key.
      Parameters:
      tx - Transaction or null for implicit transaction.
      keyRec - A record with key columns set. The key cannot be null.
      Returns:
      Future that represents the pending completion of the operation.
      Throws:
      MarshallerException - if the key doesn't match the schema.
    • containsAsync

      default CompletableFuture<Boolean> containsAsync(R keyRec)
      Determines whether a table contains an entry for the specified key.
      Parameters:
      keyRec - A record with key columns set. The key cannot be null.
      Returns:
      Future that represents the pending completion of the operation.
      Throws:
      MarshallerException - if the key doesn't match the schema.
    • containsAll

      boolean containsAll(@Nullable @Nullable Transaction tx, Collection<R> keys)
      Determines whether a table contains entries for all given keys.
      Parameters:
      tx - Transaction or null for implicit transaction.
      keys - Keys whose presence is to be verified. The collection and it's values cannot be null.
      Returns:
      True if a value exists for every specified key, false otherwise.
      Throws:
      MarshallerException - if the key doesn't match the schema.
    • containsAll

      default boolean containsAll(Collection<R> keys)
      Determines whether a table contains entries for all given keys.
      Parameters:
      keys - Keys whose presence is to be verified. The collection and it's values cannot be null.
      Returns:
      True if a value exists for every specified key, false otherwise.
      Throws:
      MarshallerException - if the key doesn't match the schema.
    • containsAllAsync

      CompletableFuture<Boolean> containsAllAsync(@Nullable @Nullable Transaction tx, Collection<R> keys)
      Determines whether a table contains entries for all given keys.
      Parameters:
      tx - Transaction or null for implicit transaction.
      keys - Keys whose presence is to be verified. The collection and it's values cannot be null.
      Returns:
      Future that represents the pending completion of the operation. The result of the future will be true if a value exists for every specified key, false otherwise.
      Throws:
      MarshallerException - if the key doesn't match the schema.
    • containsAllAsync

      default CompletableFuture<Boolean> containsAllAsync(Collection<R> keys)
      Determines whether a table contains entries for all given keys.
      Parameters:
      keys - Keys whose presence is to be verified. The collection and it's values cannot be null.
      Returns:
      Future that represents the pending completion of the operation. The result of the future will be true if a value exists for every specified key, false otherwise.
      Throws:
      MarshallerException - if the key doesn't match the schema.
    • upsert

      void upsert(@Nullable @Nullable Transaction tx, R rec)
      Inserts a record into a table, if it does not exist, or replaces an existing one.
      Parameters:
      tx - Transaction or null for implicit transaction.
      rec - Record to insert into the table. The record cannot be null.
    • upsert

      default void upsert(R rec)
      Inserts a record into a table, if it does not exist, or replaces an existing one.
      Parameters:
      rec - Record to insert into the table. The record cannot be null.
    • upsertAsync

      CompletableFuture<Void> upsertAsync(@Nullable @Nullable Transaction tx, R rec)
      Asynchronously inserts a record into a table, if it does not exist, or replaces the existing one.
      Parameters:
      tx - Transaction or null for implicit transaction.
      rec - Record to insert into the table. The record cannot be null.
      Returns:
      Future that represents the pending completion of the operation.
    • upsertAsync

      default CompletableFuture<Void> upsertAsync(R rec)
      Asynchronously inserts a record into a table, if it does not exist, or replaces the existing one.
      Parameters:
      rec - Record to insert into the table. The record cannot be null.
      Returns:
      Future that represents the pending completion of the operation.
    • upsertAll

      void upsertAll(@Nullable @Nullable Transaction tx, Collection<R> recs)
      Inserts records into a table, if they do not exist, or replaces the existing ones.
      Parameters:
      tx - Transaction or null for implicit transaction.
      recs - Records to insert into the table. The records cannot be null.
    • upsertAll

      default void upsertAll(Collection<R> recs)
      Inserts records into a table, if they do not exist, or replaces the existing ones.
      Parameters:
      recs - Records to insert into the table. The records cannot be null.
    • upsertAllAsync

      CompletableFuture<Void> upsertAllAsync(@Nullable @Nullable Transaction tx, Collection<R> recs)
      Asynchronously inserts a record into a table, if it does not exist, or replaces the existing one.
      Parameters:
      tx - Transaction or null for implicit transaction.
      recs - Records to insert into the table. The records cannot be null.
      Returns:
      Future that represents the pending completion of the operation.
    • upsertAllAsync

      default CompletableFuture<Void> upsertAllAsync(Collection<R> recs)
      Asynchronously inserts a record into a table, if it does not exist, or replaces the existing one.
      Parameters:
      recs - Records to insert into the table. The records cannot be null.
      Returns:
      Future that represents the pending completion of the operation.
    • getAndUpsert

      R getAndUpsert(@Nullable @Nullable Transaction tx, R rec)
      Inserts a record into a table, or replaces an existing record and returns the replaced record.
      Parameters:
      tx - Transaction or null for implicit transaction.
      rec - A record to insert into the table. The record cannot be null.
      Returns:
      Replaced record or null if it did not exist.
    • getAndUpsert

      default R getAndUpsert(R rec)
      Inserts a record into a table, or replaces an existing record and returns the replaced record.
      Parameters:
      rec - A record to insert into the table. The record cannot be null.
      Returns:
      Replaced record or null if it did not exist.
    • getAndUpsertAsync

      CompletableFuture<R> getAndUpsertAsync(@Nullable @Nullable Transaction tx, R rec)
      Asynchronously inserts a record into a table, or replaces an existing record and returns the replaced record.
      Parameters:
      tx - Transaction or null for implicit transaction.
      rec - Record to insert into the table. The record cannot be null.
      Returns:
      Future that represents the pending completion of the operation.
    • getAndUpsertAsync

      default CompletableFuture<R> getAndUpsertAsync(R rec)
      Asynchronously inserts a record into a table, or replaces an existing record and returns the replaced record.
      Parameters:
      rec - Record to insert into the table. The record cannot be null.
      Returns:
      Future that represents the pending completion of the operation.
    • insert

      boolean insert(@Nullable @Nullable Transaction tx, R rec)
      Inserts a record into a table if it does not exists.
      Parameters:
      tx - Transaction or null for implicit transaction.
      rec - Record to insert into the table. The record cannot be null.
      Returns:
      True if successful, false otherwise.
    • insert

      default boolean insert(R rec)
      Inserts a record into a table if it does not exists.
      Parameters:
      rec - Record to insert into the table. The record cannot be null.
      Returns:
      True if successful, false otherwise.
    • insertAsync

      CompletableFuture<Boolean> insertAsync(@Nullable @Nullable Transaction tx, R rec)
      Asynchronously inserts a record into a table if it does not exists.
      Parameters:
      tx - Transaction or null for implicit transaction.
      rec - Record to insert into the table. The record cannot be null.
      Returns:
      Future that represents the pending completion of the operation.
    • insertAsync

      default CompletableFuture<Boolean> insertAsync(R rec)
      Asynchronously inserts a record into a table if it does not exists.
      Parameters:
      rec - Record to insert into the table. The record cannot be null.
      Returns:
      Future that represents the pending completion of the operation.
    • insertAll

      List<R> insertAll(@Nullable @Nullable Transaction tx, Collection<R> recs)
      Inserts into a table records that do not exist, skips those that exist.
      Parameters:
      tx - Transaction or null for implicit transaction.
      recs - Records to insert into the table. The records cannot be null.
      Returns:
      Skipped records. If a record is inserted, the element will be excluded from the collection result.
    • insertAll

      default List<R> insertAll(Collection<R> recs)
      Inserts into a table records that do not exist, skips those that exist.
      Parameters:
      recs - Records to insert into the table. The records cannot be null.
      Returns:
      Skipped records. The order of collection elements is guaranteed to be the same as the order of recs. If a record is inserted, the element will be excluded from the collection result.
    • insertAllAsync

      CompletableFuture<List<R>> insertAllAsync(@Nullable @Nullable Transaction tx, Collection<R> recs)
      Asynchronously inserts into a table records that do not exist, skips those that exist.
      Parameters:
      tx - Transaction or null for implicit transaction.
      recs - Records to insert into the table. The records cannot be null.
      Returns:
      Future representing pending completion of the operation, with rejected rows for insertion in the result. If a record is inserted, the element will be excluded from the collection result.
    • insertAllAsync

      default CompletableFuture<List<R>> insertAllAsync(Collection<R> recs)
      Asynchronously inserts into a table records that do not exist, skips those that exist.
      Parameters:
      recs - Records to insert into the table. The records cannot be null.
      Returns:
      Future representing pending completion of the operation, with rejected rows for insertion in the result. The order of collection elements is guaranteed to be the same as the order of recs. If a record is inserted, the element will be excluded from the collection result.
    • replace

      boolean replace(@Nullable @Nullable Transaction tx, R rec)
      Replaces an existing record associated with the same key column values as the given record.
      Parameters:
      tx - Transaction or null for implicit transaction.
      rec - Record to replace with. The record cannot be null.
      Returns:
      True if a record was found and replaced successfully, false otherwise.
    • replace

      default boolean replace(R rec)
      Replaces an existing record associated with the same key column values as the given record.
      Parameters:
      rec - Record to replace with. The record cannot be null.
      Returns:
      True if a record was found and replaced successfully, false otherwise.
    • replace

      @Deprecated(forRemoval=true) default boolean replace(@Nullable @Nullable Transaction tx, R oldRec, R newRec)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Replaces an expected record in the table with the given new one. Deprecated: use replaceExact(Transaction, Object, Object) instead.
      Parameters:
      tx - Transaction or null for implicit transaction.
      oldRec - Record to replace. The record cannot be null.
      newRec - Record to replace with. The record cannot be null.
      Returns:
      True if a record was replaced successfully, false otherwise.
    • replaceExact

      boolean replaceExact(@Nullable @Nullable Transaction tx, R oldRec, R newRec)
      Replaces an expected record in the table with the given new one.
      Parameters:
      oldRec - Record to replace. The record cannot be null.
      newRec - Record to replace with. The record cannot be null.
      Returns:
      True if a record was replaced successfully, false otherwise.
    • replaceExact

      default boolean replaceExact(R oldRec, R newRec)
      Replaces an expected record in the table with the given new one.
      Parameters:
      oldRec - Record to replace. The record cannot be null.
      newRec - Record to replace with. The record cannot be null.
      Returns:
      True if a record was replaced successfully, false otherwise.
    • replaceAsync

      CompletableFuture<Boolean> replaceAsync(@Nullable @Nullable Transaction tx, R rec)
      Asynchronously replaces an existing record associated with the same key columns values as the given record.
      Parameters:
      tx - Transaction or null for implicit transaction.
      rec - Record to replace with. The record cannot be null.
      Returns:
      Future that represents the pending completion of the operation.
    • replaceAsync

      default CompletableFuture<Boolean> replaceAsync(R rec)
      Asynchronously replaces an existing record associated with the same key columns values as the given record.
      Parameters:
      rec - Record to replace with. The record cannot be null.
      Returns:
      Future that represents the pending completion of the operation.
    • replaceAsync

      @Deprecated(forRemoval=true) default CompletableFuture<Boolean> replaceAsync(@Nullable @Nullable Transaction tx, R oldRec, R newRec)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Asynchronously replaces an existing record in the table with the given new one. Deprecated: use replaceExactAsync(Transaction, Object, Object) instead.
      Parameters:
      tx - Transaction or null for implicit transaction.
      oldRec - Record to replace. The record cannot be null.
      newRec - Record to replace with. The record cannot be null.
      Returns:
      Future that represents the pending completion of the operation.
    • replaceExactAsync

      CompletableFuture<Boolean> replaceExactAsync(@Nullable @Nullable Transaction tx, R oldRec, R newRec)
      Asynchronously replaces an existing record in the table with the given new one.
      Parameters:
      oldRec - Record to replace. The record cannot be null.
      newRec - Record to replace with. The record cannot be null.
      Returns:
      Future that represents the pending completion of the operation.
    • replaceExactAsync

      default CompletableFuture<Boolean> replaceExactAsync(R oldRec, R newRec)
      Asynchronously replaces an existing record in the table with the given new one.
      Parameters:
      oldRec - Record to replace. The record cannot be null.
      newRec - Record to replace with. The record cannot be null.
      Returns:
      Future that represents the pending completion of the operation.
    • getAndReplace

      R getAndReplace(@Nullable @Nullable Transaction tx, R rec)
      Gets an existing record associated with the same key columns values as the given one, then replaces it with the given one.
      Parameters:
      tx - Transaction or null for implicit transaction.
      rec - Record to replace with. The record cannot be null.
      Returns:
      Replaced record or null if it did not exist.
    • getAndReplace

      default R getAndReplace(R rec)
      Gets an existing record associated with the same key columns values as the given one, then replaces it with the given one.
      Parameters:
      rec - Record to replace with. The record cannot be null.
      Returns:
      Replaced record or null if it did not exist.
    • getAndReplaceAsync

      CompletableFuture<R> getAndReplaceAsync(@Nullable @Nullable Transaction tx, R rec)
      Asynchronously gets an existing record associated with the same key column values as the given one, then replaces it with the given one.
      Parameters:
      tx - Transaction or null for implicit transaction.
      rec - Record to replace with. The record cannot be null.
      Returns:
      Future that represents the pending completion of the operation.
    • getAndReplaceAsync

      default CompletableFuture<R> getAndReplaceAsync(R rec)
      Asynchronously gets an existing record associated with the same key column values as the given one, then replaces it with the given one.
      Parameters:
      rec - Record to replace with. The record cannot be null.
      Returns:
      Future that represents the pending completion of the operation.
    • delete

      boolean delete(@Nullable @Nullable Transaction tx, R keyRec)
      Deletes a record with the same key column values as the given one from a table.
      Parameters:
      tx - Transaction or null for implicit transaction.
      keyRec - Record with the key columns set. The record cannot be null.
      Returns:
      True if removed successfully, false otherwise.
    • delete

      default boolean delete(R keyRec)
      Deletes a record with the same key column values as the given one from a table.
      Parameters:
      keyRec - Record with the key columns set. The record cannot be null.
      Returns:
      True if removed successfully, false otherwise.
    • deleteAsync

      CompletableFuture<Boolean> deleteAsync(@Nullable @Nullable Transaction tx, R keyRec)
      Asynchronously deletes a record with the same key column values as the given one from a table.
      Parameters:
      tx - Transaction or null for implicit transaction.
      keyRec - Record with the key columns set. The record cannot be null.
      Returns:
      Future that represents the pending completion of the operation.
    • deleteAsync

      default CompletableFuture<Boolean> deleteAsync(R keyRec)
      Asynchronously deletes a record with the same key column values as the given one from a table.
      Parameters:
      keyRec - Record with the key columns set. The record cannot be null.
      Returns:
      Future that represents the pending completion of the operation.
    • deleteExact

      boolean deleteExact(@Nullable @Nullable Transaction tx, R rec)
      Deletes the given record from a table.
      Parameters:
      tx - Transaction or null for implicit transaction.
      rec - Record to delete. The record cannot be null.
      Returns:
      True if removed successfully, false otherwise.
    • deleteExact

      default boolean deleteExact(R rec)
      Deletes the given record from a table.
      Parameters:
      rec - Record to delete. The record cannot be null.
      Returns:
      True if removed successfully, false otherwise.
    • deleteExactAsync

      CompletableFuture<Boolean> deleteExactAsync(@Nullable @Nullable Transaction tx, R rec)
      Asynchronously deletes the given record from a table.
      Parameters:
      tx - Transaction or null for implicit transaction.
      rec - Record to delete. The record cannot be null.
      Returns:
      Future that represents the pending completion of the operation.
    • deleteExactAsync

      default CompletableFuture<Boolean> deleteExactAsync(R rec)
      Asynchronously deletes the given record from a table.
      Parameters:
      rec - Record to delete. The record cannot be null.
      Returns:
      Future that represents the pending completion of the operation.
    • getAndDelete

      R getAndDelete(@Nullable @Nullable Transaction tx, R keyRec)
      Gets and deletes from a table a record with the same key column values as the given one.
      Parameters:
      tx - Transaction or null for implicit transaction.
      keyRec - Record with the key columns set. The record cannot be null.
      Returns:
      Removed record or null if it did not exist.
    • getAndDelete

      default R getAndDelete(R keyRec)
      Gets and deletes from a table a record with the same key column values as the given one.
      Parameters:
      keyRec - Record with the key columns set. The record cannot be null.
      Returns:
      Removed record or null if it did not exist.
    • getAndDeleteAsync

      CompletableFuture<R> getAndDeleteAsync(@Nullable @Nullable Transaction tx, R keyRec)
      Asynchronously gets and deletes from a table a record with the same key columns values as the given one.
      Parameters:
      tx - Transaction or null for implicit transaction.
      keyRec - Record with the key columns set. The record cannot be null.
      Returns:
      Future that represents the pending completion of the operation.
    • getAndDeleteAsync

      default CompletableFuture<R> getAndDeleteAsync(R keyRec)
      Asynchronously gets and deletes from a table a record with the same key columns values as the given one.
      Parameters:
      keyRec - Record with the key columns set. The record cannot be null.
      Returns:
      Future that represents the pending completion of the operation.
    • deleteAll

      List<R> deleteAll(@Nullable @Nullable Transaction tx, Collection<R> keyRecs)
      Removes from a table records with the same key column values as the given one.
      Parameters:
      tx - Transaction or null for implicit transaction.
      keyRecs - Records with the key columns set. The records cannot be null.
      Returns:
      Records with the key columns set that did not exist. If a record is removed, the element will be excluded from the collection result.
    • deleteAll

      void deleteAll(@Nullable @Nullable Transaction tx)
      Removes all entries from a table records.
      Parameters:
      tx - Transaction or null for implicit transaction.
    • deleteAll

      default void deleteAll()
      Removes all entries from a table records.
    • deleteAllAsync

      CompletableFuture<List<R>> deleteAllAsync(@Nullable @Nullable Transaction tx, Collection<R> keyRecs)
      Asynchronously removes from a table records with the same key column values as the given one.
      Parameters:
      tx - Transaction or null for implicit transaction.
      keyRecs - Records with the key columns set. The records cannot be null.
      Returns:
      Future represents the pending completion of the operation, with rejected rows for deletion in the result. If a record is removed, the element will be excluded from the collection result.
    • deleteAllAsync

      CompletableFuture<Void> deleteAllAsync(@Nullable @Nullable Transaction tx)
      Asynchronously removes all entries from a table records.
      Parameters:
      tx - Transaction or null for implicit transaction.
      Returns:
      Future represents the pending completion of the operation.
    • deleteAllAsync

      default CompletableFuture<Void> deleteAllAsync()
      Asynchronously removes all entries from a table records.
      Returns:
      Future represents the pending completion of the operation.
    • deleteAllExact

      List<R> deleteAllExact(@Nullable @Nullable Transaction tx, Collection<R> recs)
      Remove the given records from a table.
      Parameters:
      tx - Transaction or null for implicit transaction.
      recs - Records to delete. The records cannot be null.
      Returns:
      Records that were not deleted. If a record is removed, the element will be excluded from the collection result.
    • deleteAllExact

      default List<R> deleteAllExact(Collection<R> recs)
      Remove the given records from a table.
      Parameters:
      recs - Records to delete. The records cannot be null.
      Returns:
      Records that were not deleted. The order of collection elements is guaranteed to be the same as the order of recs. If a record is removed, the element will be excluded from the collection result.
    • deleteAllExactAsync

      CompletableFuture<List<R>> deleteAllExactAsync(@Nullable @Nullable Transaction tx, Collection<R> recs)
      Asynchronously removes the given records from a table.
      Parameters:
      tx - Transaction or null for implicit transaction.
      recs - Records to delete. The records cannot be null.
      Returns:
      Future represents the pending completion of the operation, with rejected rows for deletion in the result. If a record is removed, the element will be excluded from the collection result.
    • deleteAllExactAsync

      default CompletableFuture<List<R>> deleteAllExactAsync(Collection<R> recs)
      Asynchronously removes the given records from a table.
      Parameters:
      recs - Records to delete. The records cannot be null.
      Returns:
      Future represents the pending completion of the operation, with rejected rows for deletion in the result. The order of collection elements is guaranteed to be the same as the order of recs. If a record is removed, the element will be excluded from the collection result.