create()
のメソッドを使用して、クライアント上でプロキシを作成できますRequestContext
。あなたの場合、プロキシValueProxy
はEntityProxy
. 値プロキシを「保存」する必要はありません (エンティティ プロキシとは異なります)。
私はあなたとまったく同じユースケースを持っていますが、それは非常にうまく機能します。
@Service(MyService.class)
interface MyRequestContext extends RequestContext {
Request<List<TaskProxy>> findTasks(FilterProxy filter);
}
@ProxyFor(Filter.class)
interface FilterProxy extends ValueProxy {
// your getters and setters here
}
...
MyRequestContext ctx = ...;
FilterProxy filter = ctx.create(FilterProxy.class);
filter.setXxx(...);
// set your other filter
ctx.findTasks(filter).fire(new Receiver<List<TaskProxy>>() {
@Override
public void onSuccess(List<TaskProxy> tasks) {
// ...
}
});
補足として、「パラメーターとして使用できるのは xxxProxy オブジェクトのみ」と書いていましたが、これは誤りです。int
プリミティブ型 ( 、boolean
など)、それらのラッパー型 ( Integer
、Boolean
など)、String
、Date
、およびそれら (List
またはSet
プロキシ型) をうまく使用できます。