Search in sources :

Example 96 with Fieldsonly

use of mbg.test.mb3.generated.conditional.model.Fieldsonly in project generator by mybatis.

the class SimpleAnnotatedTest method testFieldsOnly.

@Test
public void testFieldsOnly() {
    SqlSession sqlSession = sqlSessionFactory.openSession();
    try {
        FieldsonlyMapper mapper = sqlSession.getMapper(FieldsonlyMapper.class);
        Fieldsonly record = new Fieldsonly();
        record.setDoublefield(1.23);
        record.setFloatfield(4.35);
        record.setIntegerfield(9);
        mapper.insert(record);
        record = new Fieldsonly();
        record.setDoublefield(11.2233);
        record.setFloatfield(44.3355);
        record.setIntegerfield(99);
        mapper.insert(record);
        List<Fieldsonly> records = mapper.selectAll();
        assertEquals(2, records.size());
    } finally {
        sqlSession.close();
    }
}
Also used : SqlSession(org.apache.ibatis.session.SqlSession) FieldsonlyMapper(mbg.test.mb3.generated.simpleannotated.mapper.FieldsonlyMapper) Fieldsonly(mbg.test.mb3.generated.simpleannotated.model.Fieldsonly) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)89 SqlSession (org.apache.ibatis.session.SqlSession)82 FieldsonlyMapper (mbg.test.mb3.generated.annotated.flat.mapper.FieldsonlyMapper)8 Fieldsonly (mbg.test.mb3.generated.annotated.flat.model.Fieldsonly)8 FieldsonlyExample (mbg.test.mb3.generated.annotated.flat.model.FieldsonlyExample)8 FieldsonlyMapper (mbg.test.mb3.generated.mixed.flat.mapper.FieldsonlyMapper)8 Fieldsonly (mbg.test.mb3.generated.mixed.flat.model.Fieldsonly)8 FieldsonlyExample (mbg.test.mb3.generated.mixed.flat.model.FieldsonlyExample)8 SQLException (java.sql.SQLException)7 FieldsonlyDAO (mbg.test.ib2j2.generated.conditional.dao.FieldsonlyDAO)7 Fieldsonly (mbg.test.ib2j2.generated.conditional.model.Fieldsonly)7 FieldsonlyExample (mbg.test.ib2j2.generated.conditional.model.FieldsonlyExample)7 FieldsonlyDAO (mbg.test.ib2j5.generated.conditional.dao.FieldsonlyDAO)7 Fieldsonly (mbg.test.ib2j5.generated.conditional.model.Fieldsonly)7 FieldsonlyExample (mbg.test.ib2j5.generated.conditional.model.FieldsonlyExample)7 FieldsonlyMapper (mbg.test.mb3.generated.annotated.conditional.mapper.FieldsonlyMapper)7 Fieldsonly (mbg.test.mb3.generated.annotated.conditional.model.Fieldsonly)7 FieldsonlyExample (mbg.test.mb3.generated.annotated.conditional.model.FieldsonlyExample)7 FieldsonlyMapper (mbg.test.mb3.generated.annotated.hierarchical.Immutable.Mapper.FieldsonlyMapper)7 Fieldsonly (mbg.test.mb3.generated.annotated.hierarchical.Immutable.Model.Fieldsonly)7