// Write the method here.. public void create__facebookAccessToken( FacebookAccessToken data, RestAdapter restAdapter, final ObjectCallback<FacebookAccessToken> callback) { // Call the onBefore callback method.. callback.onBefore(); // Define methods here.. final CustomerRepository customerRepo = restAdapter.createRepository(CustomerRepository.class); customerRepo.create__facebookAccessToken( (String) that.getId(), data.convertMap(), new ObjectCallback<FacebookAccessToken>() { @Override public void onSuccess(FacebookAccessToken object) { if (object != null) { // now add relation to this recipe. addRelation(object); // Also add relation to child type for two way communication..Removing two way // communication for cyclic error // object.addRelation(that); callback.onSuccess(object); // Calling the finally..callback callback.onFinally(); } else { callback.onSuccess(null); // Calling the finally..callback callback.onFinally(); } } @Override public void onError(Throwable t) { // Now calling the callback callback.onError(t); // Calling the finally..callback callback.onFinally(); } }); } // method def ends here.