use of mbg.test.mb3.common.TestEnum in project generator by mybatis.
the class MiscellaneousTest method testEnum.
@Test
public void testEnum() {
SqlSession sqlSession = sqlSessionFactory.openSession();
try {
EnumtestMapper mapper = sqlSession.getMapper(EnumtestMapper.class);
Enumtest enumTest = new Enumtest();
enumTest.setId(1);
enumTest.setName(TestEnum.FRED);
int rows = mapper.insert(enumTest);
assertEquals(1, rows);
List<Enumtest> returnedRecords = mapper.selectByExample(null);
assertEquals(1, returnedRecords.size());
Enumtest returnedRecord = returnedRecords.get(0);
assertEquals(1, returnedRecord.getId().intValue());
assertEquals(TestEnum.FRED, returnedRecord.getName());
} finally {
sqlSession.close();
}
}
use of mbg.test.mb3.common.TestEnum in project generator by mybatis.
the class MiscellaneousTest method testEnum.
@Test
public void testEnum() {
SqlSession sqlSession = sqlSessionFactory.openSession();
try {
EnumtestMapper mapper = sqlSession.getMapper(EnumtestMapper.class);
Enumtest enumTest = new Enumtest();
enumTest.setId(1);
enumTest.setName(TestEnum.FRED);
int rows = mapper.insert(enumTest);
assertEquals(1, rows);
List<Enumtest> returnedRecords = mapper.selectByExample(null);
assertEquals(1, returnedRecords.size());
Enumtest returnedRecord = returnedRecords.get(0);
assertEquals(1, returnedRecord.getId().intValue());
assertEquals(TestEnum.FRED, returnedRecord.getName());
} finally {
sqlSession.close();
}
}
use of mbg.test.mb3.common.TestEnum in project generator by mybatis.
the class MiscellaneousTest method testEnum.
@Test
public void testEnum() {
SqlSession sqlSession = sqlSessionFactory.openSession();
try {
EnumtestMapper mapper = sqlSession.getMapper(EnumtestMapper.class);
Enumtest enumTest = new Enumtest();
enumTest.setId(1);
enumTest.setName(TestEnum.FRED);
int rows = mapper.insert(enumTest);
assertEquals(1, rows);
List<Enumtest> returnedRecords = mapper.selectByExample(null);
assertEquals(1, returnedRecords.size());
Enumtest returnedRecord = returnedRecords.get(0);
assertEquals(1, returnedRecord.getId().intValue());
assertEquals(TestEnum.FRED, returnedRecord.getName());
} finally {
sqlSession.close();
}
}
use of mbg.test.mb3.common.TestEnum in project generator by mybatis.
the class MiscellaneousTest method testEnum.
@Test
public void testEnum() {
try (SqlSession sqlSession = sqlSessionFactory.openSession()) {
EnumtestMapper mapper = sqlSession.getMapper(EnumtestMapper.class);
Enumtest enumTest = new Enumtest();
enumTest.setId(1);
enumTest.setName(TestEnum.FRED);
int rows = mapper.insert(enumTest);
assertEquals(1, rows);
List<Enumtest> returnedRecords = mapper.select(SelectDSLCompleter.allRows());
assertEquals(1, returnedRecords.size());
Enumtest returnedRecord = returnedRecords.get(0);
assertEquals(1, returnedRecord.getId().intValue());
assertEquals(TestEnum.FRED, returnedRecord.getName());
}
}
Aggregations