arp.repository.SimplePersistenceRepository Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ARP Show documentation
Show all versions of ARP Show documentation
a java development framework with aggregation, repository and process
The newest version!
package arp.repository;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
public abstract class SimplePersistenceRepository extends
PersistenceRepository {
@Override
protected E findByIdForUpdateImpl(I id) {
return findByIdImpl(id);
}
@Override
protected E saveIfAbsentImpl(I id, E entity) {
E existsEntity = findByIdImpl(id);
if (existsEntity == null) {
saveImpl(id, entity);
}
return existsEntity;
}
@Override
protected void updateBatchImpl(Map entitiesToUpdate) {
for (Entry entry : entitiesToUpdate.entrySet()) {
updateImpl(entry.getKey(), entry.getValue());
}
}
@Override
protected void saveBatchImpl(Map entities) {
for (Entry entry : entities.entrySet()) {
saveImpl(entry.getKey(), entry.getValue());
}
}
@Override
protected void removeBatchImpl(Set ids) {
for (I id : ids) {
removeImpl(id);
}
}
@Override
protected void unlockBatchImpl(Set ids) {
}
@Override
protected void unlockImpl(I id) {
}
}