com.holonplatform.vaadin.data

## Interface ItemDataSource.CommitHandler<ITEM>

- Type Parameters:
    `ITEM` - Item type
  All Superinterfaces:
    Serializable
  Enclosing interface:
    ItemDataSource<ITEM,PROPERTY>
  Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

      @FunctionalInterface
      public static interface ItemDataSource.CommitHandler<ITEM>
      extends Serializable

  Data source commit handler to perform concrete persistence operations when data is committed invoking `ItemDataSource.commit()`.

- - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `commit(Collection<ITEM> addedItems, Collection<ITEM> modifiedItems, Collection<ITEM> removedItems)` Commit item modifications.
    `static <T> ItemDataSource.CommitHandler<T>` | `datastore(Class<? extends T> beanClass, com.holonplatform.core.datastore.Datastore datastore, com.holonplatform.core.datastore.DataTarget<?> target)` Construct a new `ItemDataSource.CommitHandler` for bean type items using a `Datastore` to perform persistence operations.
    `static ItemDataSource.CommitHandler<com.holonplatform.core.property.PropertyBox>` | `datastore(com.holonplatform.core.datastore.Datastore datastore, com.holonplatform.core.datastore.DataTarget<?> target)` Construct a new `ItemDataSource.CommitHandler` for `PropertyBox` type items using a `Datastore` to perform persistence operations.

- - ### Method Detail

    - #### commit

          void commit(Collection<ITEM> addedItems,
                      Collection<ITEM> modifiedItems,
                      Collection<ITEM> removedItems)

      Commit item modifications.
      Parameters:
        `addedItems` - Added items: an empty collection if none
        `modifiedItems` - Modified items: an empty collection if none
        `removedItems` - Removed items: an empty collection if none

    - #### datastore

          static ItemDataSource.CommitHandler<com.holonplatform.core.property.PropertyBox> datastore(com.holonplatform.core.datastore.Datastore datastore,
                                                                                                     com.holonplatform.core.datastore.DataTarget<?> target)

      Construct a new `ItemDataSource.CommitHandler` for `PropertyBox` type items using a `Datastore` to perform persistence operations.
      Parameters:
        `datastore` - The datastore to use (not null)
        `target` - The data target to use (not null)
      Returns:
        The `ItemDataSource.CommitHandler` instance

    - #### datastore

          static <T> ItemDataSource.CommitHandler<T> datastore(Class<? extends T> beanClass,
                                                               com.holonplatform.core.datastore.Datastore datastore,
                                                               com.holonplatform.core.datastore.DataTarget<?> target)

      Construct a new `ItemDataSource.CommitHandler` for bean type items using a `Datastore` to perform persistence operations.
      Type Parameters:
        `T` - Bean type
      Parameters:
        `beanClass` - Bean class (not null)
        `datastore` - The datastore to use (not null)
        `target` - The data target to use (not null)
      Returns:
        The `ItemDataSource.CommitHandler` instance

Copyright © 2019 The Holon Platform. All rights reserved.