use of weborb.client.IChainedResponder in project Android-SDK by Backendless.
the class Persistence method findById.
protected <E> void findById(E entity, List<String> relations, Integer relationsDepth, AsyncCallback<E> responder) {
try {
if (entity == null)
throw new IllegalArgumentException(ExceptionMessage.NULL_ENTITY);
IChainedResponder chainedResponder = new AdaptingResponder<E>((Class<E>) entity.getClass(), new PoJoAdaptingPolicy<E>());
Object entityArg = ReflectionUtil.hasField(entity.getClass(), Persistence.DEFAULT_OBJECT_ID_FIELD) ? entity : FootprintsManager.getInstance().getObjectId(entity);
Invoker.invokeAsync(PERSISTENCE_MANAGER_SERVER_ALIAS, "findById", new Object[] { BackendlessSerializer.getSimpleName(entity.getClass()), entityArg, relations, relationsDepth }, responder, chainedResponder);
} catch (Throwable e) {
if (responder != null)
responder.handleFault(new BackendlessFault(e));
}
}
Aggregations