Search in sources :

Example 6 with DbQuery

use of jodd.db.DbQuery in project jodd by oblac.

the class DbEnumTest method testEnums.

@Test
public void testEnums() {
    DbSession session = new DbThreadSession(cp);
    String sql = "create table ENUMERATOR(ID int, NAME varchar(20), STATUS int)";
    DbQuery query = new DbQuery(sql);
    query.executeUpdate();
    Enumerator e = new Enumerator();
    e.id = 2;
    e.name = "Ikigami";
    e.status = Enumerator.STATUS.ONE;
    DbSqlGenerator gen = insert(e);
    query = new DbOomQuery(gen);
    query.executeUpdate();
    session.closeSession();
}
Also used : DbSession(jodd.db.DbSession) DbQuery(jodd.db.DbQuery) Enumerator(jodd.db.oom.tst.Enumerator) DbThreadSession(jodd.db.DbThreadSession) Test(org.junit.Test)

Aggregations

DbQuery (jodd.db.DbQuery)6 DbThreadSession (jodd.db.DbThreadSession)4 DbSession (jodd.db.DbSession)3 Test (org.junit.Test)3 ResultSet (java.sql.ResultSet)2 SQLException (java.sql.SQLException)1 Iterator (java.util.Iterator)1 List (java.util.List)1 Set (java.util.Set)1 QueryMapper (jodd.db.QueryMapper)1 DbEntityDescriptor (jodd.db.oom.DbEntityDescriptor)1 DbOomException (jodd.db.oom.DbOomException)1 DbOomManager (jodd.db.oom.DbOomManager)1 DbSqlBuilder (jodd.db.oom.sqlgen.DbSqlBuilder)1 Enumerator (jodd.db.oom.tst.Enumerator)1 Girl (jodd.db.oom.tst.Girl)1 Girl2 (jodd.db.oom.tst.Girl2)1 IdName (jodd.db.oom.tst.IdName)1 Before (org.junit.Before)1