java.lang.Object
org.seasar.doma.jdbc.query.BatchUpdateQueryHelper<E>
- Type Parameters:
E- the entity type
A helper class for batch update queries. This class provides utility methods for handling entity
properties in batch update operations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ConfigThe configuration.protected final EntityType<E>The entity type.protected final String[]The excluded property names.protected final String[]The included property names.protected final booleanWhether the optimistic lock exception is suppressed.protected final booleanWhether the version property is ignored. -
Constructor Summary
ConstructorsConstructorDescriptionBatchUpdateQueryHelper(Config config, EntityType<E> entityType, String[] includedPropertyNames, String[] excludedPropertyNames, boolean versionIgnored, boolean optimisticLockExceptionSuppressed) Constructs a newBatchUpdateQueryHelper. -
Method Summary
Modifier and TypeMethodDescriptionList<EntityPropertyType<E,?>> Returns the target property types for the update operation.protected booleanisTargetPropertyName(String name) Determines if the property name is a target for the update operation.voidpopulateValues(E entity, List<EntityPropertyType<E, ?>> targetPropertyTypes, EntityPropertyType<E, ?> versionPropertyType, SqlContext context) Populates the SQL context with values from the entity.
-
Field Details
-
config
The configuration. -
entityType
The entity type. -
versionIgnored
protected final boolean versionIgnoredWhether the version property is ignored. -
optimisticLockExceptionSuppressed
protected final boolean optimisticLockExceptionSuppressedWhether the optimistic lock exception is suppressed. -
includedPropertyNames
The included property names. -
excludedPropertyNames
The excluded property names.
-
-
Constructor Details
-
BatchUpdateQueryHelper
public BatchUpdateQueryHelper(Config config, EntityType<E> entityType, String[] includedPropertyNames, String[] excludedPropertyNames, boolean versionIgnored, boolean optimisticLockExceptionSuppressed) Constructs a newBatchUpdateQueryHelper.- Parameters:
config- the configurationentityType- the entity typeincludedPropertyNames- the included property namesexcludedPropertyNames- the excluded property namesversionIgnored- whether the version property is ignoredoptimisticLockExceptionSuppressed- whether the optimistic lock exception is suppressed
-
-
Method Details
-
getTargetPropertyTypes
Returns the target property types for the update operation. This method filters the entity property types based on various criteria.- Returns:
- the list of target property types
-
isTargetPropertyName
Determines if the property name is a target for the update operation. This method checks if the property name is included and not excluded.- Parameters:
name- the property name- Returns:
- true if the property name is a target, false otherwise
-
populateValues
public void populateValues(E entity, List<EntityPropertyType<E, ?>> targetPropertyTypes, EntityPropertyType<E, ?> versionPropertyType, SqlContext context) Populates the SQL context with values from the entity. This method appends SQL for setting column values in the update statement.- Parameters:
entity- the entitytargetPropertyTypes- the target property typesversionPropertyType- the version property typecontext- the SQL context
-