com.holonplatform.vaadin.data

## Interface DatastoreDataProvider

- All Superinterfaces:
    com.vaadin.data.provider.DataProvider<com.holonplatform.core.property.PropertyBox,com.holonplatform.core.query.QueryFilter>, QueryConfigurationProviderSupport, Serializable

      public interface DatastoreDataProvider
      extends com.vaadin.data.provider.DataProvider<com.holonplatform.core.property.PropertyBox,com.holonplatform.core.query.QueryFilter>, QueryConfigurationProviderSupport

  A `DataProvider` backed by a `Datastore`.

  The data type is `PropertyBox` and the supported filter type is `QueryFilter`.

  Supports `QueryConfigurationProvider` registration through `QueryConfigurationProviderSupport`.

  Since:
    5.0.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `DatastoreDataProvider.Builder` Builder to create `DatastoreDataProvider` instances.

  - ### Method Summary

    All Methods Static Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static DatastoreDataProvider.Builder` | `builder()` Get a builder to create `DatastoreDataProvider` instances.
    `static DatastoreDataProvider` | `create(com.holonplatform.core.datastore.Datastore datastore, com.holonplatform.core.datastore.DataTarget<?> target, com.holonplatform.core.property.PropertySet<?> propertySet)` Create a new `DatastoreDataProvider`.
    `static DatastoreDataProvider` | `create(com.holonplatform.core.datastore.Datastore datastore, com.holonplatform.core.datastore.DataTarget<?> target, com.holonplatform.core.property.PropertySet<?> propertySet, ItemIdentifierProvider<com.holonplatform.core.property.PropertyBox,Object> itemIdentifier)` Create a `DatastoreDataProvider`, using given `ItemIdentifierProvider` to obtain the `PropertyBox` item identifier.
    `static DatastoreDataProvider` | `create(com.holonplatform.core.datastore.Datastore datastore, com.holonplatform.core.datastore.DataTarget<?> target, com.holonplatform.core.property.PropertySet<?> propertySet, com.holonplatform.core.property.Property<?>... identifierProperties)` Create a `DatastoreDataProvider` and use given `identifierProperties` as `PropertyBox` items identifiers.

    - ### Methods inherited from interface com.vaadin.data.provider.DataProvider

      `addDataProviderListener, fetch, fromCallbacks, fromFilteringCallbacks, fromStream, getId, isInMemory, ofCollection, ofItems, refreshAll, refreshItem, size, withConfigurableFilter, withConfigurableFilter, withConvertedFilter`

    - ### Methods inherited from interface com.holonplatform.vaadin.data.QueryConfigurationProviderSupport

      `addQueryConfigurationProvider`

- - ### Method Detail

    - #### create

          static DatastoreDataProvider create(com.holonplatform.core.datastore.Datastore datastore,
                                              com.holonplatform.core.datastore.DataTarget<?> target,
                                              com.holonplatform.core.property.PropertySet<?> propertySet)

      Create a new `DatastoreDataProvider`.

      The `PropertyBox` items will be fetched from the persistence source using a properly configured Datastore query, with given `dataTarget` representing the persistent entity to query. The `PropertyBox` items will be built using given `propertySet`.

      The `DataProvider.getId(Object)` method will simply return the `PropertyBox` item instance, relying on the `PropertyBox` `equals` and `hashCode` logic to identify each item.

      If the given `PropertySet` provides identifier properties (see `PropertySet.getIdentifiers()`), the identifier properties will be used as `PropertyBox` item identifiers, i.e. the `equals` and `hashCode` logic of the items will be implemented accordingly to the values of the identifier properties.

      Parameters:
        `datastore` - The `Datastore` to use (not null)
        `target` - The data target to use (not null)
        `propertySet` - The query projection property set (not null)
      Returns:
        A new `DatastoreDataProvider` instance

    - #### create

          static DatastoreDataProvider create(com.holonplatform.core.datastore.Datastore datastore,
                                              com.holonplatform.core.datastore.DataTarget<?> target,
                                              com.holonplatform.core.property.PropertySet<?> propertySet,
                                              com.holonplatform.core.property.Property<?>... identifierProperties)

      Create a `DatastoreDataProvider` and use given `identifierProperties` as `PropertyBox` items identifiers.

      The `PropertyBox` items will be fetched from the persistence source using a properly configured Datastore query, with given `dataTarget` representing the persistent entity to query. The `PropertyBox` items will be built using given `propertySet`.

      The provided identifier properties will be used as `PropertyBox` item identifiers, i.e. the `equals` and `hashCode` logic of the items will be implemented accordingly to the values of the identifier properties.

      Parameters:
        `datastore` - The `Datastore` to use (not null)
        `target` - The data target to use (not null)
        `propertySet` - The query projection property set (not null)
        `identifierProperties` - Properties to use as item identifiers
      Returns:
        A new `DatastoreDataProvider` instance

    - #### create

          static DatastoreDataProvider create(com.holonplatform.core.datastore.Datastore datastore,
                                              com.holonplatform.core.datastore.DataTarget<?> target,
                                              com.holonplatform.core.property.PropertySet<?> propertySet,
                                              ItemIdentifierProvider<com.holonplatform.core.property.PropertyBox,Object> itemIdentifier)

      Create a `DatastoreDataProvider`, using given `ItemIdentifierProvider` to obtain the `PropertyBox` item identifier.

      The `PropertyBox` items will be fetched from the persistence source using a properly configured Datastore query, with given `dataTarget` representing the persistent entity to query. The `PropertyBox` items will be built using given `propertySet`.

      The given `itemIdentifier` will be used to provide the item identifier through the `DataProvider.getId(Object)` method.

      Parameters:
        `datastore` - The `Datastore` to use (not null)
        `target` - The data target to use (not null)
        `propertySet` - The query projection property set (not null)
        `itemIdentifier` - Item identifier provider
      Returns:
        A new `DatastoreDataProvider` instance

    - #### builder

          static DatastoreDataProvider.Builder builder()

      Get a builder to create `DatastoreDataProvider` instances.
      Returns:
        DatastoreDataProvider builder

Copyright © 2019 The Holon Platform. All rights reserved.