Class SqlFileBatchDeleteQuery<ELEMENT>

java.lang.Object
org.seasar.doma.jdbc.query.AbstractQuery
org.seasar.doma.jdbc.query.SqlFileBatchModifyQuery<ELEMENT>
org.seasar.doma.jdbc.query.SqlFileBatchDeleteQuery<ELEMENT>
Type Parameters:
ELEMENT - the type of elements in the batch
All Implemented Interfaces:
BatchDeleteQuery, BatchModifyQuery, Query

public class SqlFileBatchDeleteQuery<ELEMENT> extends SqlFileBatchModifyQuery<ELEMENT> implements BatchDeleteQuery
A query that performs batch delete operations using an external SQL file.

This class extends SqlFileBatchModifyQuery to provide functionality for executing batch DELETE statements defined in external SQL files. It handles entity lifecycle callbacks, optimistic locking, and SQL file execution for multiple entities.

  • Field Details

    • entityHandler

      protected SqlFileBatchDeleteQuery<ELEMENT>.EntityHandler entityHandler
      The entity handler for this query.
    • versionIgnored

      protected boolean versionIgnored
      Whether to ignore the version property for optimistic locking.
    • optimisticLockExceptionSuppressed

      protected boolean optimisticLockExceptionSuppressed
      Whether to suppress optimistic lock exceptions.
  • Constructor Details

    • SqlFileBatchDeleteQuery

      public SqlFileBatchDeleteQuery(Class<ELEMENT> elementClass)
      Constructs a new instance with the specified element class.
      Parameters:
      elementClass - the class of elements in the batch
  • Method Details

    • prepare

      public void prepare()
      Prepares this query for execution. This method must be called before the query is executed.

      This implementation validates that required components are not null.

      This implementation prepares the SQL statements for each entity in the batch, executing pre-delete callbacks and optimistic lock preparation.

      Specified by:
      prepare in interface Query
      Overrides:
      prepare in class SqlFileBatchModifyQuery<ELEMENT>
    • preDelete

      protected void preDelete()
      Executes pre-delete entity lifecycle callbacks.

      This method delegates to the entity handler if one is available.

    • prepareOptimisticLock

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

      This method delegates to the entity handler if one is available.

    • complete

      public void complete()
      Completes this query after execution. This method must be called after the query is executed.

      This implementation executes post-delete entity lifecycle callbacks for each entity in the batch.

      Specified by:
      complete in interface Query
    • setEntityType

      public void setEntityType(EntityType<ELEMENT> entityType)
      Sets the entity type for this query.

      This implementation creates an entity handler for the specified entity type.

      Specified by:
      setEntityType in class SqlFileBatchModifyQuery<ELEMENT>
      Parameters:
      entityType - the entity type
    • setVersionIgnored

      public void setVersionIgnored(boolean versionIgnored)
      Sets whether to ignore the version property for optimistic locking.
      Parameters:
      versionIgnored - whether to ignore the version property
    • setOptimisticLockExceptionSuppressed

      public void setOptimisticLockExceptionSuppressed(boolean optimisticLockExceptionSuppressed)
      Sets whether to suppress optimistic lock exceptions.
      Parameters:
      optimisticLockExceptionSuppressed - whether to suppress optimistic lock exceptions