Class GenerationState.PendingState

java.lang.Object
org.fastnate.generator.context.GenerationState
org.fastnate.generator.context.GenerationState.PendingState
Enclosing class:
GenerationState

public static final class GenerationState.PendingState extends GenerationState
Marks all pending updates for an entity, that was not written up to now.
  • Field Details

  • Constructor Details

    • PendingState

      public PendingState()
  • Method Details

    • addPendingUpdate

      public <E> void addPendingUpdate(E entity, Property<E,?> property, Object... arguments)
      Adds an entity that has to be updated, as soon as the associated entity (of this state) was written.
      Parameters:
      entity - the entity to update
      property - the property to write
      arguments - additional arguments to remember
    • writePendingStatements

      public <E> void writePendingStatements(StatementsWriter writer, Object entity) throws IOException
      Generates the update statements for all entities that are required after the given entity was generated.
      Parameters:
      writer - the target of the generated statements
      entity - the entity that exists now in the database
      Throws:
      IOException - if the writer throws one
    • getUpdates

      public List<GenerationState.PendingState.Update<?>> getUpdates()