Skip to content

Commit e080542

Browse files
committed
Delete unused DbAction.Merge and related methods.
1 parent f569920 commit e080542

File tree

2 files changed

+0
-54
lines changed

2 files changed

+0
-54
lines changed

spring-data-jdbc/src/main/java/org/springframework/data/jdbc/core/JdbcAggregateChangeExecutionContext.java

-12
Original file line numberDiff line numberDiff line change
@@ -171,18 +171,6 @@ <T> void executeDeleteAll(DbAction.DeleteAll<T> delete) {
171171
accessStrategy.deleteAll(delete.getPropertyPath());
172172
}
173173

174-
<T> void executeMerge(DbAction.Merge<T> merge) {
175-
176-
// temporary implementation
177-
if (!accessStrategy.update(merge.getEntity(), merge.getEntityType())) {
178-
179-
Object id = accessStrategy.insert(merge.getEntity(), merge.getEntityType(), getParentKeys(merge, converter), false);
180-
add(new DbActionExecutionResult(merge, id));
181-
} else {
182-
add(new DbActionExecutionResult());
183-
}
184-
}
185-
186174
<T> void executeAcquireLock(DbAction.AcquireLockRoot<T> acquireLock) {
187175
accessStrategy.acquireLockById(acquireLock.getId(), LockMode.PESSIMISTIC_WRITE, acquireLock.getEntityType());
188176
}

spring-data-relational/src/main/java/org/springframework/data/relational/core/conversion/DbAction.java

-42
Original file line numberDiff line numberDiff line change
@@ -177,48 +177,6 @@ public String toString() {
177177
}
178178
}
179179

180-
/**
181-
* Represents a merge statement for a single entity that is not the root of an aggregate.
182-
*
183-
* @param <T> type of the entity for which this represents a database interaction.
184-
*/
185-
final class Merge<T> implements WithDependingOn<T>, WithPropertyPath<T> {
186-
187-
private final T entity;
188-
private final PersistentPropertyPath<RelationalPersistentProperty> propertyPath;
189-
private final WithEntity<?> dependingOn;
190-
191-
private final Map<PersistentPropertyPath<RelationalPersistentProperty>, Object> qualifiers = Collections.emptyMap();
192-
193-
public Merge(T entity, PersistentPropertyPath<RelationalPersistentProperty> propertyPath,
194-
WithEntity<?> dependingOn) {
195-
this.entity = entity;
196-
this.propertyPath = propertyPath;
197-
this.dependingOn = dependingOn;
198-
}
199-
200-
public T getEntity() {
201-
return this.entity;
202-
}
203-
204-
public PersistentPropertyPath<RelationalPersistentProperty> getPropertyPath() {
205-
return this.propertyPath;
206-
}
207-
208-
public DbAction.WithEntity<?> getDependingOn() {
209-
return this.dependingOn;
210-
}
211-
212-
public Map<PersistentPropertyPath<RelationalPersistentProperty>, Object> getQualifiers() {
213-
return this.qualifiers;
214-
}
215-
216-
public String toString() {
217-
return "DbAction.Merge(entity=" + this.getEntity() + ", propertyPath=" + this.getPropertyPath() + ", dependingOn="
218-
+ this.getDependingOn() + ", qualifiers=" + this.getQualifiers() + ")";
219-
}
220-
}
221-
222180
/**
223181
* Represents a delete statement for all entities that that a reachable via a give path from the aggregate root.
224182
*

0 commit comments

Comments
 (0)