Search in sources :

Example 6 with Regexrename

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

the class MiscellaneousTest method testRegexRenameInsert.

@Test
public void testRegexRenameInsert() {
    SqlSession sqlSession = sqlSessionFactory.openSession();
    try {
        RegexrenameMapper mapper = sqlSession.getMapper(RegexrenameMapper.class);
        Regexrename record = new Regexrename();
        record.setAddress("123 Main Street");
        record.setName("Fred");
        record.setZipCode("99999");
        mapper.insert(record);
        Regexrename returnedRecord = mapper.selectByPrimaryKey(1);
        assertEquals(record.getAddress(), returnedRecord.getAddress());
        assertEquals(1, returnedRecord.getId().intValue());
        assertEquals(record.getName(), returnedRecord.getName());
        assertEquals(record.getZipCode(), returnedRecord.getZipCode());
    } finally {
        sqlSession.close();
    }
}
Also used : SqlSession(org.apache.ibatis.session.SqlSession) Regexrename(mbg.test.mb3.generated.miscellaneous.model.Regexrename) RegexrenameMapper(mbg.test.mb3.generated.miscellaneous.mapper.RegexrenameMapper) Test(org.junit.jupiter.api.Test)

Aggregations

SQLException (java.sql.SQLException)4 RegexrenameDAO (mbg.test.ib2j2.generated.miscellaneous.dao.RegexrenameDAO)2 Regexrename (mbg.test.ib2j2.generated.miscellaneous.model.Regexrename)2 RegexrenameDAO (mbg.test.ib2j5.generated.miscellaneous.dao.RegexrenameDAO)2 Regexrename (mbg.test.ib2j5.generated.miscellaneous.model.Regexrename)2 RegexrenameMapper (mbg.test.mb3.generated.miscellaneous.mapper.RegexrenameMapper)2 Regexrename (mbg.test.mb3.generated.miscellaneous.model.Regexrename)2 SqlSession (org.apache.ibatis.session.SqlSession)2 Test (org.junit.Test)2 Test (org.junit.jupiter.api.Test)2