Search in sources :

Example 1 with Anotherawfultable

use of mbg.test.ib2j5.generated.miscellaneous.model.Anotherawfultable in project generator by mybatis.

the class MiscellaneousTest method testAnotherAwfulTableInsert.

@Test
public void testAnotherAwfulTableInsert() {
    SqlMapClient sqlMap = getSqlMapClient();
    try {
        Anotherawfultable record = new Anotherawfultable();
        record.setId(5);
        record.setSelect("select");
        record.setInsert("insert");
        sqlMap.insert("MBGTEST_ANOTHERAWFULTABLE.insert", record);
        Anotherawfultable key = new Anotherawfultable();
        key.setId(5);
        Anotherawfultable returnedRecord = (Anotherawfultable) sqlMap.queryForObject("MBGTEST_ANOTHERAWFULTABLE.selectByPrimaryKey", key);
        assertEquals(record.getId(), returnedRecord.getId());
        assertEquals(record.getSelect(), returnedRecord.getSelect());
        assertEquals(record.getInsert(), returnedRecord.getInsert());
        assertEquals(record.getUpdate(), returnedRecord.getUpdate());
        assertEquals(record.getDelete(), returnedRecord.getDelete());
    } catch (SQLException e) {
        fail(e.getMessage());
    }
}
Also used : Anotherawfultable(mbg.test.ib2j5.generated.miscellaneous.model.Anotherawfultable) SQLException(java.sql.SQLException) SqlMapClient(com.ibatis.sqlmap.client.SqlMapClient) Test(org.junit.Test)

Aggregations

SqlMapClient (com.ibatis.sqlmap.client.SqlMapClient)1 SQLException (java.sql.SQLException)1 Anotherawfultable (mbg.test.ib2j5.generated.miscellaneous.model.Anotherawfultable)1 Test (org.junit.Test)1