Package com.google.web.bindery.requestfactory.shared

Examples of com.google.web.bindery.requestfactory.shared.SimpleBarRequest.persistAndReturnSelf()


              @Override
              public void onSuccess(SimpleFooProxy fooProxy) {
                fooProxy = checkSerialization(fooProxy);
                SimpleFooRequest context = simpleFooRequest();
                Request<SimpleFooProxy> updReq =
                    context.persistAndReturnSelf().using(fooProxy).with("oneToManySetField");
                fooProxy = context.edit(fooProxy);

                Set<SimpleBarProxy> setField = fooProxy.getOneToManySetField();
                final int listCount = setField.size();
                setField.add(barProxy);
View Full Code Here


    SimpleBarRequest context = simpleBarRequest();
    SimpleBarProxy willDelete = context.create(SimpleBarProxy.class);
    willDelete.setUserName("A");

    // Persist the newly-created object
    context.persistAndReturnSelf().using(willDelete).fire(new Receiver<SimpleBarProxy>() {
      @Override
      public void onSuccess(SimpleBarProxy response) {
        response = checkSerialization(response);
        assertEquals("A", response.getUserName());
        // Mark the object as deleted
View Full Code Here

        // Mark the object as deleted
        SimpleBarRequest context = simpleBarRequest();
        response = context.edit(response);
        response.setFindFails(true);
        response.setUserName("B");
        context.persistAndReturnSelf().using(response).fire(new Receiver<SimpleBarProxy>() {

          @Override
          public void onSuccess(SimpleBarProxy response) {
            response = checkSerialization(response);
            // The last-known state should be returned
View Full Code Here

            // Ensure attempts to mutate deleted objects don't blow up
            response = context.edit(response);
            response.setUserName("C");

            // Attempting to use the now-deleted object should fail
            context.persistAndReturnSelf().using(response).fire(new Receiver<SimpleBarProxy>() {
              @Override
              public void onFailure(ServerFailure error) {
                assertTrue(error.getMessage().contains(
                    "The requested entity is not available on" + " the server"));
                finishTestAndReset();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.