Class SqlFileBatchUpdateQuery.EntityHandler

java.lang.Object
org.seasar.doma.jdbc.query.SqlFileBatchUpdateQuery.EntityHandler
Enclosing class:
SqlFileBatchUpdateQuery<ELEMENT>

protected class SqlFileBatchUpdateQuery.EntityHandler extends Object
A handler for entity lifecycle callbacks, optimistic locking, and value population.
  • Field Details

  • Constructor Details

    • EntityHandler

      protected EntityHandler(EntityType<ELEMENT> entityType)
      Constructs a new instance with the specified entity type.
      Parameters:
      entityType - the entity type
  • Method Details

    • init

      protected void init()
      Initializes this handler.

      This method creates a batch update query helper with the configured properties.

    • preUpdate

      protected void preUpdate()
      Executes pre-update entity lifecycle callbacks.

      This method creates a pre-update context and calls the entity type's preUpdate method.

    • prepareTargetPropertyTypes

      protected void prepareTargetPropertyTypes()
      Prepares the target property types for this query.

      This method retrieves the target property types from the helper.

    • postUpdate

      protected void postUpdate()
      Executes post-update entity lifecycle callbacks.

      This method creates a post-update context, calls the entity type's postUpdate method, and saves the current state of the entity.

    • prepareOptimisticLock

      protected void prepareOptimisticLock()
      Prepares optimistic locking for this query.

      This method sets the optimistic lock check flag based on the version property and configuration.

    • incrementVersions

      protected void incrementVersions()
      Increments version values for optimistic locking.

      This method increments the version property value for each entity in the batch if optimistic locking is enabled.

    • populateValues

      protected void populateValues(SqlContext context)
      Populates values in the SQL context.

      This method delegates to the helper to populate values for the current entity.

      Parameters:
      context - the SQL context