Package mbg.test.mb3.generated.hierarchical.immutable.model

Examples of mbg.test.mb3.generated.hierarchical.immutable.model.PkblobsExample


    public void testPKOnlyInsert() {
        SqlSession sqlSession = sqlSessionFactory.openSession();

        try {
            PkonlyMapper mapper = sqlSession.getMapper(PkonlyMapper.class);
            PkonlyKey key = new PkonlyKey();
            key.setId(1);
            key.setSeqNum(3);
            mapper.insert(key);

            PkonlyExample example = new PkonlyExample();
            List<PkonlyKey> answer = mapper.selectByExample(example);
            assertEquals(1, answer.size());

            PkonlyKey returnedRecord = answer.get(0);
            assertEquals(key.getId(), returnedRecord.getId());
            assertEquals(key.getSeqNum(), returnedRecord.getSeqNum());
        } finally {
            sqlSession.close();
        }
    }
View Full Code Here


    public void testPKOnlyDeleteByPrimaryKey() {
        SqlSession sqlSession = sqlSessionFactory.openSession();

        try {
            PkonlyMapper mapper = sqlSession.getMapper(PkonlyMapper.class);
            PkonlyKey key = new PkonlyKey();
            key.setId(1);
            key.setSeqNum(3);
            mapper.insert(key);

            key = new PkonlyKey();
            key.setId(5);
            key.setSeqNum(6);
            mapper.insert(key);

            PkonlyExample example = new PkonlyExample();
            List<PkonlyKey> answer = mapper.selectByExample(example);
            assertEquals(2, answer.size());

            key = new PkonlyKey();
            key.setId(5);
            key.setSeqNum(6);
            int rows = mapper.deleteByPrimaryKey(key);
            assertEquals(1, rows);

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

    public void testPKOnlyDeleteByExample() {
        SqlSession sqlSession = sqlSessionFactory.openSession();

        try {
            PkonlyMapper mapper = sqlSession.getMapper(PkonlyMapper.class);
            PkonlyKey key = new PkonlyKey();
            key.setId(1);
            key.setSeqNum(3);
            mapper.insert(key);

            key = new PkonlyKey();
            key.setId(5);
            key.setSeqNum(6);
            mapper.insert(key);

            key = new PkonlyKey();
            key.setId(7);
            key.setSeqNum(8);
            mapper.insert(key);

            PkonlyExample example = new PkonlyExample();
            example.createCriteria().andIdGreaterThan(4);
            int rows = mapper.deleteByExample(example);
View Full Code Here

    public void testPKOnlySelectByExample() {
        SqlSession sqlSession = sqlSessionFactory.openSession();

        try {
            PkonlyMapper mapper = sqlSession.getMapper(PkonlyMapper.class);
            PkonlyKey key = new PkonlyKey();
            key.setId(1);
            key.setSeqNum(3);
            mapper.insert(key);

            key = new PkonlyKey();
            key.setId(5);
            key.setSeqNum(6);
            mapper.insert(key);

            key = new PkonlyKey();
            key.setId(7);
            key.setSeqNum(8);
            mapper.insert(key);

            PkonlyExample example = new PkonlyExample();
            example.createCriteria().andIdGreaterThan(4);
            List<PkonlyKey> answer = mapper.selectByExample(example);
View Full Code Here

    public void testPKOnlySelectByExampleNoCriteria() {
        SqlSession sqlSession = sqlSessionFactory.openSession();

        try {
            PkonlyMapper mapper = sqlSession.getMapper(PkonlyMapper.class);
            PkonlyKey key = new PkonlyKey();
            key.setId(1);
            key.setSeqNum(3);
            mapper.insert(key);

            key = new PkonlyKey();
            key.setId(5);
            key.setSeqNum(6);
            mapper.insert(key);

            key = new PkonlyKey();
            key.setId(7);
            key.setSeqNum(8);
            mapper.insert(key);

            PkonlyExample example = new PkonlyExample();
            example.createCriteria();
            List<PkonlyKey> answer = mapper.selectByExample(example);
View Full Code Here

    public void testPKOnlyCountByExample() {
        SqlSession sqlSession = sqlSessionFactory.openSession();

        try {
            PkonlyMapper mapper = sqlSession.getMapper(PkonlyMapper.class);
            PkonlyKey key = new PkonlyKey();
            key.setId(1);
            key.setSeqNum(3);
            mapper.insert(key);

            key = new PkonlyKey();
            key.setId(5);
            key.setSeqNum(6);
            mapper.insert(key);

            key = new PkonlyKey();
            key.setId(7);
            key.setSeqNum(8);
            mapper.insert(key);

            PkonlyExample example = new PkonlyExample();
            example.createCriteria().andIdGreaterThan(4);
            int rows = mapper.countByExample(example);
View Full Code Here

            mapper.insert(record);

            PkblobsWithBLOBs newRecord = new PkblobsWithBLOBs(null,
                    generateRandomBlob(), null, null);

            PkblobsExample example = new PkblobsExample();
            example.createCriteria().andIdGreaterThan(4);
            int rows = mapper.updateByExampleSelective(newRecord, example);
            assertEquals(1, rows);

            List<PkblobsWithBLOBs> answer = mapper
                    .selectByExampleWithBLOBs(example);
View Full Code Here

                    generateRandomBlob(), "Long String 2");
            mapper.insert(record);

            PkblobsKey newRecord = new PkblobsKey(8);

            PkblobsExample example = new PkblobsExample();
            example.createCriteria().andIdGreaterThan(4);
            int rows = mapper.updateByExample(newRecord, example);
            assertEquals(1, rows);

            List<PkblobsWithBLOBs> answer = mapper
                    .selectByExampleWithBLOBs(example);
View Full Code Here

                    generateRandomBlob(), "Long String 2");
            mapper.insert(record);

            PkblobsWithBLOBs newRecord = new PkblobsWithBLOBs(8, null, null, null);

            PkblobsExample example = new PkblobsExample();
            example.createCriteria().andIdGreaterThan(4);
            int rows = mapper.updateByExampleWithBLOBs(newRecord, example);
            assertEquals(1, rows);

            List<PkblobsWithBLOBs> answer = mapper
                    .selectByExampleWithBLOBs(example);
View Full Code Here

            PkblobsMapper mapper = sqlSession.getMapper(PkblobsMapper.class);
            PkblobsWithBLOBs record = new PkblobsWithBLOBs(3, generateRandomBlob(), generateRandomBlob(),
                    "Long String 1");
            mapper.insert(record);

            PkblobsExample example = new PkblobsExample();
            List<PkblobsWithBLOBs> answer = mapper
                    .selectByExampleWithBLOBs(example);
            assertEquals(1, answer.size());

            PkblobsWithBLOBs returnedRecord = answer.get(0);
View Full Code Here

TOP

Related Classes of mbg.test.mb3.generated.hierarchical.immutable.model.PkblobsExample

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.