Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## net.java.ao
Interface ValueGenerator<T>

    public interface ValueGenerator<T>

A super-interface designed to allow auto-generated values to be inserted into database fields on INSERT. Potentially, this could be expanded to also include on UPDATE functionality, but for the moment it only handles on entity creation (INSERT). Implementations are assumed to be completely stateless and thus thread-safe.

The type parameter represents the return type of the method which does the actual generation.

Author:
  Daniel Spiewak
See Also:
  `Generator`

Method Summary
`T` | `generateValue(EntityManager manager)` Generate a new value for an arbitrary field.

Method Detail

### generateValue

    T generateValue(EntityManager manager)

  Generate a new value for an arbitrary field. No write database operations should be performed within this method. The `EntityManager` instance is only intended to ensure various field constraints (such as uniqueness for primary keys). Great care should be taken with performing such operations, as the value generation method needs to be extremely efficient.

  Parameters:
    `manager` - An instance to gain read access to the database.
  Returns:
    A new value of the relevant type for INSERT.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2007-2011. All Rights Reserved.