Package com.alvazan.test.db

Examples of com.alvazan.test.db.EntityWithUUIDKey


    Assert.assertEquals(k.getSomething(), entity.getSomething());
  }
 
  @Test
  public void testUUIDKey() {
    EntityWithUUIDKey enUID = new EntityWithUUIDKey();
    enUID.setSomething("testingUUIDconverter");
   
    mgr.put(enUID);
    mgr.flush();
   
    NoSqlEntityManager mgr2 = factory.createEntityManager();
    EntityWithUUIDKey entity = mgr2.find(EntityWithUUIDKey.class, enUID.getId());
    Assert.assertEquals(enUID.getSomething(), entity.getSomething());

    mgr.remove(enUID);
    mgr.flush();
  }
View Full Code Here


    Account acc1 = new Account();
    acc1.setId("acc1");
    acc1.setName("acc1name");
    mgr.fillInWithKey(acc1);

    EntityWithUUIDKey entity = new EntityWithUUIDKey();
    entity.setSomething("something");
    entity.setAccount(acc1);
    mgr.fillInWithKey(entity);
    // mgr.put(entity);

    User user = new User();
    user.setUuidEntity(entity);

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

    User user2 = mgr.find(User.class, user.getId());
    Assert.assertNotNull(user2);
    Assert.assertEquals(entity.getId(), user2.getUuidEntity().getId());
  }
View Full Code Here

TOP

Related Classes of com.alvazan.test.db.EntityWithUUIDKey

Copyright © 2018 www.massapicom. 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.