Package jodd.db

Examples of jodd.db.DbSession.closeSession()


    DbOomQuery.query(session, DbEntitySql.deleteById(Tester.class, 1)).executeUpdate();

    count = DbOomQuery.query(session, DbEntitySql.count(Tester.class)).executeCount();
    assertEquals(1, count);

    session.closeSession();
  }

  // ---------------------------------------------------------------- util

  protected void assertDb(DbSession dbSession, String expected) {
View Full Code Here


    assertEquals(2, g2o.length);
    checkGirl1Alt((Girl) g2o[0]);
    checkGirl3Alt((Girl) g2o[1]);
    q.close();

    session.closeSession();

  }

  // ---------------------------------------------------------------- utils
View Full Code Here

    executeUpdate(session, "insert into GIRL(ID, NAME, SPECIALITY) values(1, 'Anna', 'swim')");
    executeUpdate(session, "insert into GIRL(ID, NAME, SPECIALITY) values(2, 'Sandra', 'piano')");
    executeUpdate(session, "insert into GIRL(NAME) values('Monica')");

    session.closeSession();
    assertTrue(session.isSessionClosed());


    // prepare
    session = new DbThreadSession(cp);
View Full Code Here

    assertEquals(1, DbOomManager.getInstance().getTotalTableNames());
    assertEquals(2, DbOomManager.getInstance().getTotalNames());

    q.close();

    session.closeSession();


    /**
     * Test fails on HSQLDB 1.8 since generated columns are not supported.
     */
 
View Full Code Here

    }
    q.closeResultSet(rs);
    q.close();
    assertEquals(0, q.getOpenResultSetCount());

    session.closeSession();


    session = new DbThreadSession(cp);
    DbOomManager.getInstance().registerEntity(Girl2.class, true);
    Girl2 g2 = new Girl2("Gwen");
View Full Code Here

    assertEquals("Gwen", g2.name);
    assertNull(g2.speciality);
    assertNotNull(g2.time);
    assertEquals(7, g2.id.intValue());

    session.closeSession();


    session = new DbThreadSession(cp);

    q = DbSqlBuilder.sql("select * from $T{Girl g} where $g.name like :what order by $g.id").query();
View Full Code Here

    assertEquals(2, girls.size());
    checkGirl4(girls.get(0));
    checkGirl5(girls.get(1));
    q.close();

    session.closeSession();
  }


  private void checkGirl4(Girl2 girl) {
    assertNotNull(girl);
View Full Code Here

    assertEquals(1, boy2.girlAlt.id);
    assertNotNull(boy2.girlAlt.name);
    assertNull(boy2.girlAlt.speciality);


    dbSession.closeSession();
  }

}
View Full Code Here

    DbSqlGenerator gen = insert(e);
    query = new DbOomQuery(gen);
    query.executeUpdate();

    session.closeSession();
  }

}
View Full Code Here

    assertNotNull(girl);
    assertEquals("Anna", girl.name);
    assertEquals("swim", girl.speciality);
    assertEquals(1, girl.id);

    session.closeSession();
  }

  @DbTable
  public static class Bean1 {
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.