Examples of persistAndReturnSelf()


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

  public void testFetchDeletedEntity() {
    delayTestFinish(TEST_DELAY);
    SimpleBarRequest context = req.simpleBarRequest();
    SimpleBarProxy willDelete = context.create(SimpleBarProxy.class);
    context.persistAndReturnSelf().using(willDelete).fire(new Receiver<SimpleBarProxy>() {
      @Override
      public void onSuccess(SimpleBarProxy response) {
        final EntityProxyId<SimpleBarProxy> id = response.stableId();

        // Make the entity behave as though it's been deleted
View Full Code Here

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

    delayTestFinish(DELAY_TEST_FINISH);

    SimpleBarRequest context = simpleBarRequest();
    final SimpleBarProxy foo = context.create(SimpleBarProxy.class);
    assertTrue(((SimpleEntityProxyId<?>) foo.stableId()).isEphemeral());
    Request<SimpleBarProxy> fooReq = context.persistAndReturnSelf().using(foo);
    fooReq.fire(new Receiver<SimpleBarProxy>() {

      @Override
      public void onSuccess(SimpleBarProxy returned) {
        returned = checkSerialization(returned);
View Full Code Here

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

    // Check that a newly-created object's token can be found
    assertEquals(futureId, req.getProxyId(futureToken));
    assertEquals(futureId.getProxyClass(), req.getProxyClass(futureToken));

    Request<SimpleBarProxy> fooReq = context.persistAndReturnSelf().using(foo);
    fooReq.fire(new Receiver<SimpleBarProxy>() {
      @Override
      public void onSuccess(SimpleBarProxy returned) {
        returned = checkSerialization(returned);
        EntityProxyId<SimpleBarProxy> persistedId = returned.stableId();
View Full Code Here

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

    SimpleFooRequest context = simpleFooRequest();
    final SimpleFooProxy foo = context.create(SimpleFooProxy.class);
    final Object futureId = foo.getId();
    assertTrue(((SimpleEntityProxyId<?>) foo.stableId()).isEphemeral());
    Request<SimpleFooProxy> fooReq = context.persistAndReturnSelf().using(foo);

    final SimpleFooProxy newFoo = context.edit(foo);
    assertEquals(futureId, foo.getId());
    assertTrue(((SimpleEntityProxyId<?>) foo.stableId()).isEphemeral());
    assertEquals(futureId, newFoo.getId());
View Full Code Here

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

        assertFalse(((SimpleEntityProxyId<?>) returned.stableId()).isEphemeral());

        checkStableIdEquals(foo, returned);
        checkStableIdEquals(newFoo, returned);
        SimpleFooRequest context = simpleFooRequest();
        Request<SimpleFooProxy> editRequest = context.persistAndReturnSelf().using(returned);
        final SimpleFooProxy editableFoo = context.edit(returned);
        editableFoo.setUserName("GWT power user");
        editRequest.fire(new Receiver<SimpleFooProxy>() {

          @Override
View Full Code Here

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

            // Set
            foo.setSimpleValue(created);
            foo.setSimpleValues(Collections.singletonList(created));

            context.persistAndReturnSelf().using(foo).with("barField", "oneToManyField",
                "oneToManySetField", "simpleValue", "simpleValues").fire(
                new Receiver<SimpleFooProxy>() {
                  @Override
                  public void onSuccess(SimpleFooProxy response) {
                    RequestMessage requestMessage =
View Full Code Here

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

        // Set
        response = req.edit(response);
        response.setSimpleValue(created);

        // Retrieve
        req.persistAndReturnSelf().using(response).with("simpleValue.simpleFoo",
            "simpleValue.simpleValue").to(new Receiver<SimpleFooProxy>() {
          @Override
          public void onSuccess(SimpleFooProxy response) {
            response = checkSerialization(response);
            SimpleValueProxy value = response.getSimpleValue();
View Full Code Here

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

            // Update
            SimpleFooRequest req = simpleFooRequest();
            response = req.edit(response);
            response.getSimpleValue().setNumber(43);
            req.persistAndReturnSelf().using(response).with("simpleValue").to(
                new Receiver<SimpleFooProxy>() {
                  @Override
                  public void onSuccess(SimpleFooProxy response) {
                    response = checkSerialization(response);
                    assertEquals(43, response.getSimpleValue().getNumber());
View Full Code Here

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

        // Set
        response = req.edit(response);
        response.setSimpleValues(Arrays.asList(created1, created2));

        // Retrieve
        req.persistAndReturnSelf().using(response).with("simpleValues").to(
            new Receiver<SimpleFooProxy>() {
              @Override
              public void onSuccess(SimpleFooProxy response) {
                response = checkSerialization(response);
                assertEquals(2, response.getSimpleValues().size());
View Full Code Here

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

                // Update
                SimpleFooRequest req = simpleFooRequest();
                response = req.edit(response);
                response.getSimpleValues().get(0).setNumber(44);
                req.persistAndReturnSelf().using(response).with("simpleValues").to(
                    new Receiver<SimpleFooProxy>() {
                      @Override
                      public void onSuccess(SimpleFooProxy response) {
                        response = checkSerialization(response);
                        assertEquals(44, response.getSimpleValues().get(0).getNumber());
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.