com.avaje.ebean.delegate.DelegateFind Maven / Gradle / Ivy
package com.avaje.ebean.delegate;
import com.avaje.ebean.EbeanServer;
import com.avaje.ebean.FutureIds;
import com.avaje.ebean.FutureList;
import com.avaje.ebean.FutureRowCount;
import com.avaje.ebean.PagedList;
import com.avaje.ebean.Query;
import com.avaje.ebean.QueryEachConsumer;
import com.avaje.ebean.QueryEachWhileConsumer;
import com.avaje.ebean.Transaction;
import com.avaje.ebean.Version;
import com.avaje.ebeaninternal.api.SpiQuery;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* Wraps an underlying EbeanServer.
*
* Can you used for testing purposes when you want to create a test double that
* only replaces some of the underlying functionality of the EbeanServer.
*/
public class DelegateFind implements InterceptFind {
protected EbeanServer delegate;
/**
* Construct with a EbeanServer to delegate to by default.
*
* This delegate will be used on all method calls that are not overwritten.
*/
public DelegateFind(EbeanServer delegate) {
this.delegate = delegate;
}
@Override
public void refresh(Object bean) {
delegate.refresh(bean);
}
@Override
public void refreshMany(Object bean, String propertyName) {
delegate.refreshMany(bean, propertyName);
}
@Override
public T findUnique(Query query, Transaction transaction) {
return delegate.findUnique(query, transaction);
}
@Override
public T find(Class beanType, Object id, Transaction transaction) {
return delegate.find(beanType, id, transaction);
}
@Override
public int findRowCount(Query query, Transaction transaction) {
return delegate.findRowCount(query, transaction);
}
@Override
public List