Package org.caffinitas.mapper.core

Examples of org.caffinitas.mapper.core.PersistenceSession.executeQuery()


            // as named query

            queryBinder = session.createNamedQueryBinder(TpcBaseEntity.class, null, "byIds");
            queryBinder.setList("id", Arrays.asList(11, 12, 13));
            result = session.executeQuery(queryBinder);

            Assert.assertNotNull(result);
            Assert.assertEquals(result.size(), 3);
        } finally {session.close();}
    }
View Full Code Here


            queryBinder.setInt("id1", 31);
            queryBinder.setInt("id2", 32);
            queryBinder.setInt("id3", 33);
            queryBinder.setInt("id4", 34);
            queryBinder.setInt("id5", 35);
            List<TpcBaseEntity> result = session.executeQuery(queryBinder);

            Assert.assertNotNull(result);
            Assert.assertTrue(result.isEmpty());

            // as named query
View Full Code Here

            queryBinder.setInt("id1", 31);
            queryBinder.setInt("id2", 32);
            queryBinder.setInt("id3", 33);
            queryBinder.setInt("id4", 34);
            queryBinder.setInt("id5", 35);
            result = session.executeQuery(queryBinder);

            Assert.assertNotNull(result);
            Assert.assertTrue(result.isEmpty());

            // insert data
View Full Code Here

            queryBinder.setInt("id1", 31);
            queryBinder.setInt("id2", 32);
            queryBinder.setInt("id3", 33);
            queryBinder.setInt("id4", 34);
            queryBinder.setInt("id5", 35);
            result = session.executeQuery(queryBinder);

            Assert.assertNotNull(result);
            Assert.assertEquals(result.size(), 5);

            // as named query
View Full Code Here

            queryBinder.setInt("id1", 31);
            queryBinder.setInt("id2", 32);
            queryBinder.setInt("id3", 33);
            queryBinder.setInt("id4", 34);
            queryBinder.setInt("id5", 35);
            result = session.executeQuery(queryBinder);

            Assert.assertNotNull(result);
            Assert.assertEquals(result.size(), 5);
        } finally {session.close();}
    }
View Full Code Here

    public void tablePerClass_atB_sameCondition() throws Exception {
        PersistenceSession session = persistenceManager.createSession();
        try {
            QueryBinder<TpcInheritB> queryBinder = session.createQueryBinder(TpcInheritB.class, null, "id in :id", null);
            queryBinder.setList("id", Arrays.asList(1, 2, 3));
            List<TpcInheritB> result = session.executeQuery(queryBinder);

            Assert.assertNotNull(result);
            Assert.assertTrue(result.isEmpty());

            // as named query
View Full Code Here

            // as named query

            queryBinder = session.createNamedQueryBinder(TpcInheritB.class, null, "byIds");
            queryBinder.setList("id", Arrays.asList(1, 2, 3));
            result = session.executeQuery(queryBinder);

            Assert.assertNotNull(result);
            Assert.assertTrue(result.isEmpty());

            // insert data
View Full Code Here

            // again

            queryBinder = session.createQueryBinder(TpcInheritB.class, null, "id in :id", null);
            queryBinder.setList("id", Arrays.asList(11, 12, 13, 21, 22, 23));
            result = session.executeQuery(queryBinder);

            Assert.assertNotNull(result);
            Assert.assertEquals(result.size(), 3);

            // as named query
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.