Package com.alibaba.cobar.client.support.vo

Examples of com.alibaba.cobar.client.support.vo.BatchInsertTask


        Collections.sort(lst, comparator);
        verifyOffersOrderBySubject(lst);
    }

    private void batchInsertOffersAsFixture() {
        BatchInsertTask task = new BatchInsertTask();

        List<Offer> offers = new ArrayList<Offer>();
        Offer offer = new Offer();
        offer.setMemberId(1L);
        offer.setSubject("Z");
        offer.setGmtUpdated(new Date());
        offers.add(offer);

        offer = new Offer();
        offer.setMemberId(1L);
        offer.setSubject("X");
        offer.setGmtUpdated(new Date());
        offers.add(offer);

        offer = new Offer();
        offer.setMemberId(1L);
        offer.setSubject("S");
        offer.setGmtUpdated(new Date());
        offers.add(offer);

        offer = new Offer();
        offer.setMemberId(2L);
        offer.setSubject("D");
        offer.setGmtUpdated(new Date());
        offers.add(offer);

        offer = new Offer();
        offer.setMemberId(2L);
        offer.setSubject("A");
        offer.setGmtUpdated(new Date());
        offers.add(offer);

        task.setEntities(offers);

        getSqlMapClientTemplate().insert("com.alibaba.cobar.client.entities.Offer.batchInsert",
                task);
    }
View Full Code Here


        /**
         * NOTE: if the sqlmap is drafted with invalid format, data access
         * exception will be raised, usually, the information of exception
         * doesn't tell too much.
         */
        getSqlMapClientTemplate().insert(batchInsertSQLAction, new BatchInsertTask(followers));

        for (String name : names) {
            String sql = "select name from followers where name='" + name + "'";
            if (name.startsWith("A")) {
                verifyEntityExistenceOnSpecificDataSource(sql, jt1m);
View Full Code Here

            offer.setSubject("fake offer");
            offers.add(offer);
        }

        Object pk = getSqlMapClientTemplate().insert(
                "com.alibaba.cobar.client.entities.Offer.batchInsert", new BatchInsertTask(offers));
        return pk;
    }
View Full Code Here

        List<Follower> followers = new ArrayList<Follower>();
        for (String name : names) {
            followers.add(new Follower(name));
        }

        BatchInsertTask task = new BatchInsertTask(followers);
        getSqlMapClientTemplate().insert("com.alibaba.cobar.client.entities.Follower.batchInsert",
                task);
    }
View Full Code Here

public class NormalOfferService extends AbstractOfferService {

    @Transactional
    public void createOffersInBatch(List<Offer> offers) {
        getSqlMapClientTemplate().insert("com.alibaba.cobar.client.entities.Offer.batchInsert", new BatchInsertTask(offers));
    }
View Full Code Here

import com.alibaba.cobar.client.support.vo.BatchInsertTask;

public class AbnormalOfferService extends NormalOfferService {
    @Transactional
    public void createOffersInBatch(List<Offer> offers) {
        getSqlMapClientTemplate().insert("com.alibaba.cobar.client.entities.Offer.batchInsert", new BatchInsertTask(offers));
        throw new RuntimeException("exception to trigger rollback");
    }
View Full Code Here

TOP

Related Classes of com.alibaba.cobar.client.support.vo.BatchInsertTask

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.