Package mbg.test.mb3.generated.mixed.flat.model

Examples of mbg.test.mb3.generated.mixed.flat.model.FieldsonlyExample


            record.setTimefield(myTime);
            record.setTimestampfield(new Date());

            mapper.insert(record);

            MyObjectCriteria example = new MyObjectCriteria();
            example.createCriteria().andTimefieldEqualTo(myTime);
            List<MyObject> results = mapper.selectByExample(example);
            assertEquals(1, results.size());
            MyObject returnedRecord = results.get(0);

            assertTrue(datesAreEqual(record.getStartDate(), returnedRecord
View Full Code Here


            mapper.insert(record);

            MyObject newRecord = new MyObject();
            newRecord.setLastname("Barker");
           
            MyObjectCriteria example = new MyObjectCriteria();
            fn = new FirstName();
            fn.setValue("B%");
            example.createCriteria().andFirstnameLike(fn);
            int rows = mapper.updateByExampleSelective(newRecord, example);
            assertEquals(1, rows);

            List<MyObject> answer = mapper.selectByExample(example);
            assertEquals(1, answer.size());
View Full Code Here

            MyObject newRecord = new MyObject();
            newRecord.setLastname("Barker");
            newRecord.setId1(3);
            newRecord.setId2(4);
           
            MyObjectCriteria example = new MyObjectCriteria();
            example.createCriteria()
                .andId1EqualTo(3)
                .andId2EqualTo(4);
            int rows = mapper.updateByExample(newRecord, example);
            assertEquals(1, rows);
View Full Code Here

            record.setLastname("Rubble");
            record.setId1(2);
            record.setId2(3);
            mapper.insert(record);

            MyObjectCriteria example = new MyObjectCriteria();
            example.createCriteria().andLastnameLike("RU%");
            example.setOrderByClause("ID1, ID2");
            List<MyObject> answer = mapper.selectByExample(example);
            assertEquals(0, answer.size());
           
            example.clear();
            example.createCriteria().andLastnameLikeInsensitive("RU%");
            answer = mapper.selectByExample(example);
            assertEquals(3, answer.size());
           
            MyObject returnedRecord = answer.get(0);
            assertEquals(2, returnedRecord.getId1().intValue());
View Full Code Here

            record.setTimefield(myTime);
            record.setTimestampfield(new Date());

            mapper.insert(record);

            MyObjectKey key = new MyObjectKey();
            key.setId1(1);
            key.setId2(2);

            MyObject returnedRecord = mapper.selectByPrimaryKey(key);
            assertNotNull(returnedRecord);

            assertTrue(datesAreEqual(record.getStartDate(), returnedRecord
View Full Code Here

            record.setLastname("Jones");

            int rows = mapper.updateByPrimaryKey(record);
            assertEquals(1, rows);

            MyObjectKey key = new MyObjectKey();
            key.setId1(1);
            key.setId2(2);

            MyObject record2 = mapper.selectByPrimaryKey(key);

            assertEquals(record.getFirstname(), record2.getFirstname());
            assertEquals(record.getLastname(), record2.getLastname());
View Full Code Here

            record.setStartDate(new Date());

            int rows = mapper.updateByPrimaryKeySelective(newRecord);
            assertEquals(1, rows);

            MyObjectKey key = new MyObjectKey();
            key.setId1(1);
            key.setId2(2);

            MyObject returnedRecord = mapper.selectByPrimaryKey(key);

            assertTrue(datesAreEqual(newRecord.getStartDate(), returnedRecord
                    .getStartDate()));
View Full Code Here

            record.setId1(1);
            record.setId2(2);

            mapper.insert(record);

            MyObjectKey key = new MyObjectKey();
            key.setId1(1);
            key.setId2(2);

            int rows = mapper.deleteByPrimaryKey(key);
            assertEquals(1, rows);

            MyObjectCriteria example = new MyObjectCriteria();
View Full Code Here

            record.setLastname("Jones");
            record.setId1(3);
            record.setId2(4);
            mapper.insert(record);

            MyObjectKey key = new MyObjectKey();
            key.setId1(3);
            key.setId2(4);
            MyObject newRecord = mapper.selectByPrimaryKey(key);

            assertNotNull(newRecord);
            assertEquals(record.getFirstname(), newRecord.getFirstname());
            assertEquals(record.getLastname(), newRecord.getLastname());
View Full Code Here

    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();
        }
    }
View Full Code Here

TOP

Related Classes of mbg.test.mb3.generated.mixed.flat.model.FieldsonlyExample

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.