com.h3c.util.dao

## Class VersionedUpdateStrategy<P extends Storable<?> & Versioned,T extends Transportable<? super T,?> & Versionable>

- java.lang.Object
- - com.h3c.util.dao.VersionedUpdateStrategy<P,T>

- Type Parameters:
    `P` - type of the persistent object.
    `T` - type of the transport object.
  All Implemented Interfaces:
    UpdateStrategy<P,T>

      public class VersionedUpdateStrategy<P extends Storable<?> & Versioned,T extends Transportable<? super T,?> & Versionable>
      extends Object
      implements UpdateStrategy<P,T>

  When a transport object is updated on the database its version is checked; if the persistent object and transport object versions are not the same the operation will fail.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `VersionedUpdateStrategy()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `validateConversion(P source, T target)` This method is called when a persistent object is converted to a transport object.
    `void` | `validateUpdate(P target, T source)` Validates an update.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### VersionedUpdateStrategy

          public VersionedUpdateStrategy()

  - ### Method Detail

    - #### validateUpdate

          public void validateUpdate(P target,
                            T source)

      Description copied from interface: `UpdateStrategy`
      Validates an update. This method will be called when the persistent object is updated using the data from the transport object.
      Specified by:
        `validateUpdate` in interface `UpdateStrategy<P extends Storable<?> & Versioned,T extends Transportable<? super T,?> & Versionable>`
      Parameters:
        `target` - object to update.
        `source` - object to take the data from.

    - #### validateConversion

          public void validateConversion(P source,
                                T target)

      Description copied from interface: `UpdateStrategy`
      This method is called when a persistent object is converted to a transport object.
      Specified by:
        `validateConversion` in interface `UpdateStrategy<P extends Storable<?> & Versioned,T extends Transportable<? super T,?> & Versionable>`
      Parameters:
        `source` - object to take the data from.
        `target` - object to update.

Copyright © 2014. All Rights Reserved.