Package org.tarantool.facade

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


    SocketChannelPooledConnectionFactory connectionFactory = new SocketChannelPooledConnectionFactory("localhost", 33313, 1, 10);
    Mapping<User> mapping = new Mapping<User>(User.class, TEMPLATE_SPACE, "id", "phone", "point", "iq", "height", "lifeFormId", "salary", "birthday",
        "name", "sign", "male");

    TarantoolTemplate template = new TarantoolTemplate(connectionFactory);
    template.addMapping(mapping);
    assertNotNull(template.save(user).insertOrReplaceAndGet());
    try {
      template.save(user).insert();
      fail();
    } catch (TarantoolException ignored) {
View Full Code Here


  @Test
  public void testCycle3() throws MalformedURLException {
    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) {
View Full Code Here

  @Test
  public void testCall() throws MalformedURLException {
    Mapping<User> mapping = new Mapping<User>(User.class, 126, "id", "phone");
    SocketChannelPooledConnectionFactory connectionFactory = new SocketChannelPooledConnectionFactory("localhost", 33313, 1, 10);
    TarantoolTemplate template = new TarantoolTemplate(connectionFactory);
    template.addMapping(mapping);
    template.call(User.class, "box.delete", "126", 4321).callForOne();
    assertNotNull(template.call(User.class, "box.insert", "126", 4321, 323323L).callForOne());
    assertNull(template.call(User.class, "box.select", 126, 0, 4321).luaMode(true).callForOne());
    template.call(User.class, "box.delete", "126", 4321).callForOne();
  }
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.