I want to be able to use different locators for the same domain object. I use Twig and it has an option to load an object fully or partially. When I run the lite request, the wrong locator (TwigLocator) is used instead of TwigLiteLocator. My current implementation is:
Proxies
@ProxyFor(value = MyDomain.class, locator = TwigLocator.class)
public interface MyDomainProxy extends EntityProxy {}
@ProxyFor(value = MyDomain.class, locator = TwigLiteLocator.class)
public interface MyDomainLiteProxy extends EntityProxy {}
Request
@Service(value = MyDao.class, locator = DaoServiceLocator.class)
public interface MyRequest extends RequestContext {
Request<List<MyDomainProxy>> fetchRange(Integer start, Integer length);
Request<Integer> getCount();
Request<List<MyDomainLiteProxy>> fetchRangeLite(Integer start, Integer length);
public List<MyDomain> fetchRange(Integer start, Integer length) {
...
public List<MyDomain> fetchRangeLite(Integer start, Integer length) {
...