org.babyfish.jimmer.sql.ast.mutation.BatchSaveResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jimmer-sql Show documentation
Show all versions of jimmer-sql Show documentation
A revolutionary ORM framework for both java and kotlin
The newest version!
package org.babyfish.jimmer.sql.ast.mutation;
import org.jetbrains.annotations.NotNull;
import java.util.*;
public class BatchSaveResult extends AbstractMutationResult {
private List- > items;
public BatchSaveResult(
Map
affectedRowMap,
List- > items
) {
super(affectedRowMap);
this.items = Collections.unmodifiableList(items);
}
public List
- > getItems() {
return items;
}
@Override
public int hashCode() {
return Objects.hash(affectedRowCountMap, items);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
BatchSaveResult> that = (BatchSaveResult>) o;
return affectedRowCountMap.equals(that.affectedRowCountMap) &&
items.equals(that.items);
}
@Override
public String toString() {
return "BatchSaveResult{" +
"totalAffectedRowCount=" + totalAffectedRowCount +
", affectedRowCountMap=" + affectedRowCountMap +
", simpleResults=" + items +
'}';
}
public static class Item
implements MutationResultItem {
private final E originalEntity;
private final E modifiedEntity;
public Item(E originalEntity, E modifiedEntity) {
this.originalEntity = originalEntity;
this.modifiedEntity = modifiedEntity;
}
@NotNull
@Override
public E getOriginalEntity() {
return originalEntity;
}
@NotNull
@Override
public E getModifiedEntity() {
return modifiedEntity;
}
@Override
public String toString() {
return "Item{" +
"originalEntity=" + originalEntity +
", modifiedEntity=" + modifiedEntity +
'}';
}
}
}