Package org.tarantool.facade

Examples of org.tarantool.facade.TarantoolTemplate.find()


      fail();
    } catch (TarantoolException ignored) {

    }
    assertEquals(1, template.save(user).replace());
    assertNotNull(template.find(User.class, 0, "id").condition(user.getId()).list());
    assertEquals(user.getPhone() + 1L, template.update(User.class, user.getId()).add("phone", 1).updateAndGet().getPhone());

    connectionFactory.free();
    return;
  }
View Full Code Here


      fail();
    } catch (TarantoolException ignored) {

    }
    assertEquals(1, template.save(user).replace());
    assertNotNull(template.find(User.class, 0, "id").condition(user.getId()).list());
    assertNotNull(template.find(User.class, 1).condition(user.getName()).one());
    assertEquals(user.getPhone() + 1L, template.update(User.class, user.getId()).add("phone", 1).updateAndGet().getPhone());

    connectionFactory.free();
    return;
View Full Code Here

    } catch (TarantoolException ignored) {

    }
    assertEquals(1, template.save(user).replace());
    assertNotNull(template.find(User.class, 0, "id").condition(user.getId()).list());
    assertNotNull(template.find(User.class, 1).condition(user.getName()).one());
    assertEquals(user.getPhone() + 1L, template.update(User.class, user.getId()).add("phone", 1).updateAndGet().getPhone());

    connectionFactory.free();
    return;
  }
View Full Code Here

    Mapping<User> mapping = new Mapping7<User>(User.class, 125, "id", "phone", "point", "iq", "height", "lifeFormId", "salary", "birthday", "name", "sign",
        "male");
    TarantoolTemplate tpl = new TarantoolTemplate7(new SocketChannelPooledConnectionFactory("localhost", 33313, 1, 10));
    tpl.addMapping(mapping);
    try {
      tpl.find(User.class).condition("string");
      fail();
    } catch (IllegalArgumentException ignored) {

    }
    try {
View Full Code Here

      fail();
    } catch (IllegalArgumentException ignored) {

    }
    try {
      tpl.find(User.class, 1, "name", "phone").condition("string", 123);
      fail();
    } catch (IllegalArgumentException ignored) {

    }
    User user = new User();
View Full Code Here

    } catch (IllegalArgumentException ignored) {

    }
    User user = new User();
    tpl.delete(User.class, user.getId()).delete();
    assertNull(tpl.find(User.class, 0, "id").condition(123).one());

    assertEquals(1, tpl.save(user).insertOrReplace());
    try {
      tpl.save(user).insert();
      fail();
View Full Code Here

    }
    user.setBirthday(new Date((user.getBirthday().getTime() / 1000L) * 1000L));
    assertTrue(user.equals(tpl.save(user).replaceAndGet()));

    assertNotNull(tpl.find(User.class, 1, "name").condition(user.getName()).one());
  }

  @Test
  public void testCall() throws MalformedURLException {
    Mapping<User> mapping = new Mapping<User>(User.class, 126, "id", "phone");
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.