com.holonplatform.core.datastore

## Interface DataTarget<T>

- Type Parameters:
    `T` - Target type
  All Superinterfaces:
    Expression, Path<T>, Path.FinalPath<T>, Serializable
  All Known Subinterfaces:
    RelationalTarget<T>

      public interface DataTarget<T>
      extends Path.FinalPath<T>

  Representation of the target element of a data model persistence/query operation.

  A DataTarget is a `Path`, so the target data model entity is represented by a String path name. The path is final, i.e. does not support a parent.

  A `DataTarget.DataTargetResolver` can be used to resolve a symbolic named data target into a persistence model specific data target representation.

  Since:
    5.0.0
  See Also:
    `Datastore`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `DataTarget.DataTargetResolver<T extends DataTarget>` Convenience interface to create an `ExpressionResolver` to resolve a custom `DataTarget` class into a standard `DataTarget`.
    `static interface` | `DataTarget.DataTargetSupport<C extends DataTarget.DataTargetSupport<C>>` Interface implemented by classes which support `DataTarget` setting.

    - ### Nested classes/interfaces inherited from interface com.holonplatform.core.Path

      `Path.Builder<T,B extends Path.Builder<T,B>>, Path.FinalPath<T>, Path.PathBuilder<T>`

    - ### Nested classes/interfaces inherited from interface com.holonplatform.core.Expression

      `Expression.ExpressionResolverFunction<E extends Expression,R extends Expression>, Expression.InvalidExpressionException`

  - ### Field Summary

    - ### Fields inherited from interface com.holonplatform.core.Path

      `PATH_HIERARCHY_SEPARATOR`

  - ### Method Summary

    All Methods Static Methods Instance Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `static DataTarget<String>` | `named(String name)` Build a `String` type data target using root path `name`.
    `static <T> DataTarget<T>` | `of(String name, Class<T> type)` Build a typed data target using root path `name`.
    `default <P> PathProperty<P>` | `property(PathProperty<P> fromProperty)` Create a new `PathProperty` cloning from given `fromProperty`, setting this `DataTarget` as property parent path.
    `default <P> PathProperty.PathPropertyBuilder<P>` | `property(String name, Class<? extends P> type)` Create a new `PathProperty` with given `name` and `type`, setting this `DataTarget` as property parent path.

    - ### Methods inherited from interface com.holonplatform.core.Path.FinalPath

      `getParent`

    - ### Methods inherited from interface com.holonplatform.core.Path

      `fullName, getName, getType, isRootPath, of, relativeName, stream`

    - ### Methods inherited from interface com.holonplatform.core.Expression

      `validate`

- - ### Method Detail

    - #### property

          default <P> PathProperty.PathPropertyBuilder<P> property(String name,
                                                                   Class<? extends P> type)

      Create a new `PathProperty` with given `name` and `type`, setting this `DataTarget` as property parent path.
      Type Parameters:
        `P` - Property type
      Parameters:
        `name` - Property name (not null)
        `type` - Property value type (not null)
      Returns:
        Property builder

    - #### property

          default <P> PathProperty<P> property(PathProperty<P> fromProperty)

      Create a new `PathProperty` cloning from given `fromProperty`, setting this `DataTarget` as property parent path. Property name, type and configuration of the the property will be cloned from given property.
      Type Parameters:
        `P` - Property type
      Parameters:
        `fromProperty` - Property from which to clone (not null)
      Returns:
        The new property

    - #### named

          static DataTarget<String> named(String name)

      Build a `String` type data target using root path `name`.
      Parameters:
        `name` - Path name (not null)
      Returns:
        DataTarget instance

    - #### of

          static <T> DataTarget<T> of(String name,
                                      Class<T> type)

      Build a typed data target using root path `name`.
      Type Parameters:
        `T` - Target type
      Parameters:
        `name` - Path name (not null)
        `type` - Data target type (not null)
      Returns:
        DataTarget instance

Copyright © 2017 The Holon Platform. All rights reserved.