org.genesys.blocks.auditlog.persistence.AuditLogCustomRepository Maven / Gradle / Ivy
/*
* Copyright 2018 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.genesys.blocks.auditlog.persistence;
import java.util.List;
import org.genesys.blocks.auditlog.model.AuditLog;
import org.genesys.blocks.auditlog.model.filters.AuditLogFilter;
import org.genesys.blocks.model.ClassPK;
import org.genesys.blocks.model.EntityId;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
/**
* The Interface AuditLogCustomRepository.
*/
public interface AuditLogCustomRepository {
/**
* List audit logs.
*
* @param entity the entity
* @return the list
*/
List listAuditLogs(EntityId entity);
/**
* Gets the last audit log.
*
* @param entity the entity
* @return the last audit log
*/
AuditLog getLastAuditLog(EntityId entity);
/**
* Gets the last audit log.
*
* @param entity the entity
* @param propertyName the property name
* @return the last audit log
*/
AuditLog getLastAuditLog(EntityId entity, String propertyName);
/**
* List audit logs.
*
* @param filters the filters
* @param page the page
* @return the page
*/
Page listAuditLogs(AuditLogFilter filters, Pageable page);
/**
* Load entity from database by classname and id.
*
* @param classPk classPK of the entity
* @param id the internal database id of the entity
* @return the persisted entity of type classPk
*/
Object get(ClassPK classPk, Long id);
}