Class DeleteRequest.DeleteMappingConsumer
java.lang.Object
org.datanucleus.store.rdbms.request.DeleteRequest.DeleteMappingConsumer
- All Implemented Interfaces:
MappingConsumer
- Enclosing class:
DeleteRequest
Mapping Consumer used for generating the DELETE statement for an object in a table.
This statement will be of the form
DELETE FROM table-name WHERE id1=? AND id2=?or (when also performing version checks)
DELETE FROM table-name WHERE id1=? AND id2=? AND version={oldvers}
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List
<MappingCallbacks> Mapping Callbacks to invoke at deletion.private final org.datanucleus.ClassLoaderResolver
ClassLoaderResolverprivate final org.datanucleus.metadata.AbstractClassMetaData
MetaData for the class of the object(package private) boolean
Flag for initialisation state of the consumer.private List
Fields in a 1-1 relation with FK in the table of the other object.(package private) int
Current parameter index.(package private) StringBuilder
Where clause for the statement.private boolean
private List
WHERE clause field numbers to use in identifying the record to delete. -
Constructor Summary
ConstructorsConstructorDescriptionDeleteMappingConsumer
(org.datanucleus.ClassLoaderResolver clr, org.datanucleus.metadata.AbstractClassMetaData cmd) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
consumeMapping
(JavaTypeMapping m, org.datanucleus.metadata.AbstractMemberMetaData mmd) Consumes a mapping associated to a membervoid
consumeMapping
(JavaTypeMapping m, MappingType mappingType) Consumes a mapping for a surrogate column (version, datastore identity, multitenancy).void
Consumer a column without mapping.Obtain a List of mapping callbacks that will be run for this deletion.org.datanucleus.metadata.AbstractMemberMetaData[]
All 1-1 bidirectional non-owner fields, with the FK In the other object.Accessor for the delete SQL statement.int[]
Accessor for the field numbers of any WHERE clause fieldsvoid
preConsumeMapping
(int highest) This method is called before consuming the mappingsvoid
-
Field Details
-
initialized
boolean initializedFlag for initialisation state of the consumer. -
where
StringBuilder whereWhere clause for the statement. Built during the consumption process. -
paramIndex
int paramIndexCurrent parameter index. -
whereFields
WHERE clause field numbers to use in identifying the record to delete. -
oneToOneNonOwnerFields
Fields in a 1-1 relation with FK in the table of the other object. -
callbackMappings
Mapping Callbacks to invoke at deletion. -
clr
private final org.datanucleus.ClassLoaderResolver clrClassLoaderResolver -
cmd
private final org.datanucleus.metadata.AbstractClassMetaData cmdMetaData for the class of the object -
whereClauseConsumption
private boolean whereClauseConsumption
-
-
Constructor Details
-
DeleteMappingConsumer
public DeleteMappingConsumer(org.datanucleus.ClassLoaderResolver clr, org.datanucleus.metadata.AbstractClassMetaData cmd) Constructor.- Parameters:
clr
- the ClassLoaderResolvercmd
- AbstractClassMetaData
-
-
Method Details
-
setWhereClauseConsumption
public void setWhereClauseConsumption() -
preConsumeMapping
public void preConsumeMapping(int highest) Description copied from interface:MappingConsumer
This method is called before consuming the mappings- Specified by:
preConsumeMapping
in interfaceMappingConsumer
- Parameters:
highest
- the highest number for the fields that are going to be provided in the consumer
-
consumeMapping
Description copied from interface:MappingConsumer
Consumes a mapping associated to a member- Specified by:
consumeMapping
in interfaceMappingConsumer
- Parameters:
m
- The Java type mappingmmd
- MetaData for the member
-
consumeMapping
Consumes a mapping for a surrogate column (version, datastore identity, multitenancy). Never called with whereClauseConsumption=false- Specified by:
consumeMapping
in interfaceMappingConsumer
- Parameters:
m
- The mappingmappingType
- the Mapping type
-
consumeUnmappedColumn
Consumer a column without mapping.- Specified by:
consumeUnmappedColumn
in interfaceMappingConsumer
- Parameters:
col
- Column
-
getWhereFieldNumbers
public int[] getWhereFieldNumbers()Accessor for the field numbers of any WHERE clause fields- Returns:
- array of absolute WHERE clause field numbers
-
getOneToOneNonOwnerFields
public org.datanucleus.metadata.AbstractMemberMetaData[] getOneToOneNonOwnerFields()All 1-1 bidirectional non-owner fields, with the FK In the other object.- Returns:
- The fields that are 1-1 bidirectional with the FK at the other side.
-
getMappingCallBacks
Obtain a List of mapping callbacks that will be run for this deletion.- Returns:
- the mapping callbacks
-
getStatement
Accessor for the delete SQL statement.- Returns:
- The delete SQL statement
-
getSoftDeleteStatement
-