Examples of EmbeddedEntityWithNoId


Examples of com.alvazan.test.db.EmbeddedEntityWithNoId

  }

  @Test
  public void testEmbeddedWithoutId() {
    // Now check if an Embedded Entity without NoSqlId works or not
    EmbeddedEntityWithNoId embedWOId = new EmbeddedEntityWithNoId();
    embedWOId.setId("someid");
    embedWOId.setName("someName");
    embedWOId.setType("someType");

    User user = new User();
    user.setEntityWOId(embedWOId);

    mgr.put(user);
    mgr.flush();

    NoSqlEntityManager mgr2 = factory.createEntityManager();
    User user2 = mgr2.find(User.class, user.getId());

    EmbeddedEntityWithNoId embedWOId2 = user2.getEntityWOId();
    Assert.assertNotNull(embedWOId2);
    Assert.assertEquals(embedWOId.getId(), embedWOId2.getId());
    Assert.assertEquals(embedWOId.getName(), embedWOId2.getName());
    Assert.assertEquals(embedWOId.getType(), embedWOId2.getType());
  }
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.