package quant.rich.emoney.service.postgre;

import java.util.Collection;

import org.springframework.transaction.annotation.Transactional;

import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;

import quant.rich.emoney.config.PostgreMybatisConfig;
import quant.rich.emoney.entity.postgre.EmoneyIndex;
import quant.rich.emoney.mapper.postgre.EmoneyIndexMapper;

public class EmoneyIndexService extends PostgreServiceImpl<EmoneyIndexMapper, EmoneyIndex> {

    @Override
    @Transactional(transactionManager = PostgreMybatisConfig.POSTGRE_TRANSACTION_MANAGER, rollbackFor = Exception.class)
    public boolean saveOrUpdateBatch(Collection<EmoneyIndex> entityList, int batchSize) {
        return SqlHelper.retBool(baseMapper.insertOrUpdateBatch(entityList, batchSize));
    }
}
