com.infomaximum.platform.querypool.RemovableResource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of platform Show documentation
Show all versions of platform Show documentation
Library for creating a light platform
The newest version!
package com.infomaximum.platform.querypool;
import com.infomaximum.database.domainobject.DomainObject;
import com.infomaximum.database.domainobject.DomainObjectEditable;
import com.infomaximum.database.domainobject.filter.Filter;
import com.infomaximum.platform.exception.PlatformException;
import com.infomaximum.platform.querypool.iterator.IteratorEntity;
public interface RemovableResource extends EditableResource {
void remove(T obj, QueryTransaction transaction) throws PlatformException;
void clear(QueryTransaction transaction) throws PlatformException;
default boolean removeAll(Filter filter, QueryTransaction transaction) throws PlatformException {
boolean result = false;
try (IteratorEntity i = findAll(filter, transaction)) {
while (i.hasNext()) {
remove(i.next(), transaction);
result = true;
}
}
return result;
}
}