com.xlrit.gears.base.repository.Repository Maven / Gradle / Ivy
package com.xlrit.gears.base.repository;
import java.util.Collection;
import java.util.List;
import com.xlrit.gears.base.execution.Execution;
public interface Repository {
String LOADGRAPH = "jakarta.persistence.loadgraph";
Class getEntityType();
T findById(String id);
List findAll();
/** Creates a new (unmanaged) instance of the entity type that this repository manages. */
T newInstance(String id);
/** Creates a new (potentially managed, depending on the repository implementation) instance of the entity type that this repository manages. */
T create(Execution execution);
/** Creates an empty collection suitable for holding instances managed by this repository, with the same size as the provided list. */
List createCollection(Execution execution, List> linkedElements);
void remove(T instance, Execution execution);
void removeAll(Collection instances, Execution execution);
void publish(T instance, Execution execution);
}