com.github.gustavovitor.interfaces.ServiceInterface Maven / Gradle / Ivy
package com.github.gustavovitor.interfaces;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import javax.management.ReflectionException;
import java.util.Map;
public interface ServiceInterface {
Page findAllPageable(SP object, Pageable pageable) throws ReflectionException;
void beforeInsert(T object);
T insert(T object);
void afterInsert(T object);
void onInsertError(Throwable e, T object);
void beforeUpdate(T savedObject, T object);
T update(ID objectId, T object);
void afterUpdate(T savedObject, T object);
void onUpdateError(Throwable e, ID objectId, T object);
void beforePatch(T savedObject, Map object);
T patch(ID objectId, Map object, String... ignoreProperties);
void afterPatch(T savedObject, Map object);
void onPatchError(Throwable e, ID objectId, Map object);
void beforeDelete(T object);
void delete(ID objectId);
void afterDelete(T object);
void onDeleteError(Throwable e, T object);
void validate(T object);
Iterable findAll(SP object) throws ReflectionException;
T findById(ID objectId);
}