Class DbAction.Insert<T>
java.lang.Object
org.springframework.data.relational.core.conversion.DbAction.Insert<T>
- Type Parameters:
T
- type of the entity for which this represents a database interaction.
- All Implemented Interfaces:
DbAction<T>
,DbAction.WithDependingOn<T>
,DbAction.WithEntity<T>
,DbAction.WithPropertyPath<T>
Represents an insert statement for a single entity that is not the root of an aggregate.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.data.relational.core.conversion.DbAction
DbAction.AcquireLockAllRoot<T>, DbAction.AcquireLockRoot<T>, DbAction.BatchDelete<T>, DbAction.BatchDeleteRoot<T>, DbAction.BatchInsert<T>, DbAction.BatchInsertRoot<T>, DbAction.BatchWithValue<T,
A extends DbAction<T>, B>, DbAction.Delete<T>, DbAction.DeleteAll<T>, DbAction.DeleteAllRoot<T>, DbAction.DeleteRoot<T>, DbAction.Insert<T>, DbAction.InsertRoot<T>, DbAction.UpdateRoot<T>, DbAction.WithDependingOn<T>, DbAction.WithEntity<T>, DbAction.WithPropertyPath<T>, DbAction.WithRoot<T> -
Constructor Summary
ConstructorDescriptionInsert
(T entity, PersistentPropertyPath<RelationalPersistentProperty> propertyPath, DbAction.WithEntity<?> dependingOn, Map<PersistentPropertyPath<RelationalPersistentProperty>, Object> qualifiers, IdValueSource idValueSource) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.data.relational.core.conversion.DbAction.WithDependingOn
getQualifier
-
Constructor Details
-
Insert
public Insert(T entity, PersistentPropertyPath<RelationalPersistentProperty> propertyPath, DbAction.WithEntity<?> dependingOn, Map<PersistentPropertyPath<RelationalPersistentProperty>, Object> qualifiers, IdValueSource idValueSource)
-
-
Method Details
-
getEntityType
- Specified by:
getEntityType
in interfaceDbAction<T>
- Specified by:
getEntityType
in interfaceDbAction.WithDependingOn<T>
- Specified by:
getEntityType
in interfaceDbAction.WithEntity<T>
- Specified by:
getEntityType
in interfaceDbAction.WithPropertyPath<T>
-
getEntity
- Specified by:
getEntity
in interfaceDbAction.WithEntity<T>
- Returns:
- the entity to persist. Guaranteed to be not
null
.
-
getPropertyPath
- Specified by:
getPropertyPath
in interfaceDbAction.WithPropertyPath<T>
- Returns:
- the path from the aggregate root to the affected entity
-
getDependingOn
Description copied from interface:DbAction.WithDependingOn
TheDbAction
of a parent entity, possibly the aggregate root. This is used to obtain values needed to persist the entity, that are not part of the current entity, especially the id of the parent, which might only become available once the parent entity got persisted.- Specified by:
getDependingOn
in interfaceDbAction.WithDependingOn<T>
- Returns:
- guaranteed to be not
null
. - See Also:
-
getQualifiers
Description copied from interface:DbAction.WithDependingOn
Additional values to be set during insert or update statements.Values come from parent entities but one might also add values manually.
- Specified by:
getQualifiers
in interfaceDbAction.WithDependingOn<T>
- Returns:
- guaranteed to be not
null
.
-
getIdValueSource
- Specified by:
getIdValueSource
in interfaceDbAction.WithEntity<T>
- Returns:
- the
IdValueSource
for the entity to persist. Guaranteed to be notnull
.
-
toString
-