Examples of MongoGeneratedIdStrategyAuto


Examples of com.impetus.client.generatedId.entites.MongoGeneratedIdStrategyAuto

        catch (KunderaException e)
        {
           
            Assert.fail();
        }
        MongoGeneratedIdStrategyAuto strategyAuto = new MongoGeneratedIdStrategyAuto();
        strategyAuto.setName("kuldeep");
        try
        {
            em.persist(strategyAuto);
            em.clear();
            List<MongoGeneratedIdStrategyAuto> list = em.createQuery("Select c from MongoGeneratedIdStrategyAuto c")
                    .getResultList();
            Assert.assertNotNull(list);
            Assert.assertEquals(1, list.size());
            Assert.assertTrue(list.get(0).getId() instanceof ObjectId);
            Assert.assertEquals("kuldeep", list.get(0).getName());
            Object id = list.get(0).getId();
            em.clear();
            strategyAuto = em.find(MongoGeneratedIdStrategyAuto.class, id);
            Assert.assertNotNull(strategyAuto);
            Assert.assertEquals("kuldeep", strategyAuto.getName());
        }
        catch (KunderaException e)
        {
            Assert.fail();
        }
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.