Package com.alvazan.orm.api.base

Examples of com.alvazan.orm.api.base.NoSqlEntityManager.find()


   
    mgr.put(act);
    mgr.flush();
   
    NoSqlEntityManager mgr2 = factory.createEntityManager();
    EntityWithIntKey entity = mgr2.find(EntityWithIntKey.class, act.getId());
    Assert.assertEquals(act.getSomething(), entity.getSomething());
  }
 
  @Test
  public void testLocalDateTimeKey() {
View Full Code Here


   
    mgr.put(k);
    mgr.flush();
   
    NoSqlEntityManager mgr2 = factory.createEntityManager();
    EntityWithDateTimeKey entity = mgr2.find(EntityWithDateTimeKey.class, k.getId());
    Assert.assertEquals(k.getSomething(), entity.getSomething());
  }
 
  @Test
  public void testUUIDKey() {
View Full Code Here

   
    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

    mgr.remove(trade);
    mgr.flush();
   
    NoSqlEntityManager mgr2 = factory.createEntityManager();
   
    PartitionedSingleTrade r = mgr2.find(PartitionedSingleTrade.class, trade.getId());
    Assert.assertNull(r);
   
    Activity act = mgr2.find(Activity.class, act1.getId());
    Assert.assertNotNull(act);
    Assert.assertEquals(act1.getName(), act.getName());
View Full Code Here

    NoSqlEntityManager mgr2 = factory.createEntityManager();
   
    PartitionedSingleTrade r = mgr2.find(PartitionedSingleTrade.class, trade.getId());
    Assert.assertNull(r);
   
    Activity act = mgr2.find(Activity.class, act1.getId());
    Assert.assertNotNull(act);
    Assert.assertEquals(act1.getName(), act.getName());
   
    TimeSeriesData d2 = mgr2.find(TimeSeriesData.class, d.getKey());
    Assert.assertEquals(d.getSomeName(), d2.getSomeName());
View Full Code Here

   
    Activity act = mgr2.find(Activity.class, act1.getId());
    Assert.assertNotNull(act);
    Assert.assertEquals(act1.getName(), act.getName());
   
    TimeSeriesData d2 = mgr2.find(TimeSeriesData.class, d.getKey());
    Assert.assertEquals(d.getSomeName(), d2.getSomeName());
  }
 
}
View Full Code Here

  @Test
  public void testOrmLayerMetaSaved() {
    NoSqlEntityManagerFactory factory = FactorySingleton.createFactoryOnce();
    NoSqlEntityManager mgr = factory.createEntityManager();

    DboDatabaseMeta database = mgr.find(DboDatabaseMeta.class, DboDatabaseMeta.META_DB_ROWKEY);
    DboTableMeta table = database.getMeta("Activity");
    DboColumnMeta columnMeta = table.getColumnMeta("account");
    DboColumnToOneMeta toOne = (DboColumnToOneMeta) columnMeta;
    Assert.assertEquals("id", toOne.getFkToColumnFamily().getIdColumnMeta().getColumnName());
   
View Full Code Here

          return NoSqlModel.create(rootParamNode, name, clazz, annotations);

        Object theId = metaLayer.convertIdFromString(clazz, idStr);
       
        //Read the entity in so that this entity is used instead...
      Object o = em.find(clazz, theId);
      if(o == null)
        throw new RowNotFoundException("Row with rowkey="+theId+" was not found, but your page posted this id to lookup the row of class type="+clazz.getSimpleName());
      return NoSqlModel.edit(rootParamNode, name, o, annotations);
    }
View Full Code Here

   
    mgr.put(user);
    mgr.flush();
   
    NoSqlEntityManager mgr2 = factory.createEntityManager();
    User user2 = mgr2.find(User.class, user.getId());
   
    //Check single entity
    EmbeddedEmail emailSub = user2.getEmail();
    Assert.assertNotNull(emailSub);
    Assert.assertEquals(sub.getIdkey(), emailSub.getIdkey());
View Full Code Here

        user2.getEmails().remove(0);
        mgr3.put(user2);
        mgr3.flush();

        NoSqlEntityManager mgr4 = factory.createEntityManager();
        User user3 = mgr4.find(User.class, user2.getId());
        List<EmbeddedEmail> emails2 = user3.getEmails();
        Assert.assertEquals(2, emails2.size());

        // check if delete is working by passing object
        NoSqlEntityManager mgr5 = factory.createEntityManager();
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.