Class DeleteRequest.DeleteMappingConsumer
- java.lang.Object
-
- org.datanucleus.store.rdbms.request.DeleteRequest.DeleteMappingConsumer
-
- All Implemented Interfaces:
MappingConsumer
- Enclosing class:
- DeleteRequest
private class DeleteRequest.DeleteMappingConsumer extends java.lang.Object implements MappingConsumer
Mapping Consumer used for generating the DELETE statement for an object in a table. This statement will be of the formDELETE 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
Fields Modifier and Type Field Description private java.util.List<MappingCallbacks>callbackMappingsMapping Callbacks to invoke at deletion.private org.datanucleus.ClassLoaderResolverclrClassLoaderResolverprivate org.datanucleus.metadata.AbstractClassMetaDatacmdMetaData for the class of the object(package private) booleaninitializedFlag for initialisation state of the consumer.private java.util.ListoneToOneNonOwnerFieldsFields in a 1-1 relation with FK in the table of the other object.(package private) intparamIndexCurrent parameter index.(package private) java.lang.StringBuilderwhereWhere clause for the statement.private booleanwhereClauseConsumptionprivate java.util.ListwhereFieldsWHERE clause field numbers to use in identifying the record to delete.
-
Constructor Summary
Constructors Constructor Description DeleteMappingConsumer(org.datanucleus.ClassLoaderResolver clr, org.datanucleus.metadata.AbstractClassMetaData cmd)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconsumeMapping(JavaTypeMapping m, org.datanucleus.metadata.AbstractMemberMetaData mmd)Consumes a mapping associated to a membervoidconsumeMapping(JavaTypeMapping m, MappingType mappingType)Consumes a mapping for a surrogate column (version, datastore identity, multitenancy).voidconsumeUnmappedColumn(Column col)Consumer a column without mapping.java.util.List<MappingCallbacks>getMappingCallBacks()Obtain a List of mapping callbacks that will be run for this deletion.org.datanucleus.metadata.AbstractMemberMetaData[]getOneToOneNonOwnerFields()All 1-1 bidirectional non-owner fields, with the FK In the other object.java.lang.StringgetSoftDeleteStatement()java.lang.StringgetStatement()Accessor for the delete SQL statement.int[]getWhereFieldNumbers()Accessor for the field numbers of any WHERE clause fieldsvoidpreConsumeMapping(int highest)This method is called before consuming the mappingsvoidsetWhereClauseConsumption()
-
-
-
Field Detail
-
initialized
boolean initialized
Flag for initialisation state of the consumer.
-
where
java.lang.StringBuilder where
Where clause for the statement. Built during the consumption process.
-
paramIndex
int paramIndex
Current parameter index.
-
whereFields
private java.util.List whereFields
WHERE clause field numbers to use in identifying the record to delete.
-
oneToOneNonOwnerFields
private java.util.List oneToOneNonOwnerFields
Fields in a 1-1 relation with FK in the table of the other object.
-
callbackMappings
private java.util.List<MappingCallbacks> callbackMappings
Mapping Callbacks to invoke at deletion.
-
clr
private final org.datanucleus.ClassLoaderResolver clr
ClassLoaderResolver
-
cmd
private final org.datanucleus.metadata.AbstractClassMetaData cmd
MetaData for the class of the object
-
whereClauseConsumption
private boolean whereClauseConsumption
-
-
Method Detail
-
setWhereClauseConsumption
public void setWhereClauseConsumption()
-
preConsumeMapping
public void preConsumeMapping(int highest)
Description copied from interface:MappingConsumerThis method is called before consuming the mappings- Specified by:
preConsumeMappingin interfaceMappingConsumer- Parameters:
highest- the highest number for the fields that are going to be provided in the consumer
-
consumeMapping
public void consumeMapping(JavaTypeMapping m, org.datanucleus.metadata.AbstractMemberMetaData mmd)
Description copied from interface:MappingConsumerConsumes a mapping associated to a member- Specified by:
consumeMappingin interfaceMappingConsumer- Parameters:
m- The Java type mappingmmd- MetaData for the member
-
consumeMapping
public void consumeMapping(JavaTypeMapping m, MappingType mappingType)
Consumes a mapping for a surrogate column (version, datastore identity, multitenancy). Never called with whereClauseConsumption=false- Specified by:
consumeMappingin interfaceMappingConsumer- Parameters:
m- The mappingmappingType- the Mapping type
-
consumeUnmappedColumn
public void consumeUnmappedColumn(Column col)
Consumer a column without mapping.- Specified by:
consumeUnmappedColumnin 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
public java.util.List<MappingCallbacks> getMappingCallBacks()
Obtain a List of mapping callbacks that will be run for this deletion.- Returns:
- the mapping callbacks
-
getStatement
public java.lang.String getStatement()
Accessor for the delete SQL statement.- Returns:
- The delete SQL statement
-
getSoftDeleteStatement
public java.lang.String getSoftDeleteStatement()
-
-