io.katharsis.repository.NotFoundRepository Maven / Gradle / Ivy
package io.katharsis.repository;
import io.katharsis.queryParams.QueryParams;
import io.katharsis.repository.exception.RepositoryNotFoundException;
import java.io.Serializable;
/**
* Represents a non-existing repository. It is assigned to a resource class if Katharsis couldn't find any repository.
*/
public class NotFoundRepository implements ResourceRepository {
private final Class> repositoryClass;
public NotFoundRepository(Class extends T> repositoryClass) {
this.repositoryClass = repositoryClass;
}
@Override
public T findOne(ID id, QueryParams queryParams) {
throw new RepositoryNotFoundException(repositoryClass);
}
@Override
public Iterable findAll(QueryParams queryParams) {
throw new RepositoryNotFoundException(repositoryClass);
}
@Override
public Iterable findAll(Iterable ids, QueryParams queryParams) {
throw new RepositoryNotFoundException(repositoryClass);
}
@Override
public void delete(ID id) {
throw new RepositoryNotFoundException(repositoryClass);
}
@Override
public S save(S entity) {
throw new RepositoryNotFoundException(repositoryClass);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy