Code example for Session

Methods: createQuery

0
        simpleExtend.setValueExtend("valueExtended");
        session.save(simpleExtend);
    } 
 
    protected void tearDownDB(Session session) {
        Query query = session.createQuery("delete from simple");
        query.executeUpdate();
        query = session.createQuery("delete from SimpleBase");
        query.executeUpdate();
    } 
 
    public void testFullIndex() { 
        compassGps.index(); 
 
        CompassSession sess = compass.openSession();
        CompassTransaction tr = sess.beginTransaction();
 
        Simple simple = sess.get(Simple.class, 1);
        assertNotNull(simple);