package com.ym.mec.biz.service.impl;

import com.ym.mec.biz.dal.dao.MusicGroupPaymentEntitiesDao;
import com.ym.mec.biz.dal.entity.MusicGroupPaymentEntities;
import com.ym.mec.biz.service.MusicGroupPaymentEntitiesService;
import com.ym.mec.common.dal.BaseDAO;
import com.ym.mec.common.service.impl.BaseServiceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class MusicGroupPaymentEntitiesServiceImpl extends BaseServiceImpl<Integer, MusicGroupPaymentEntities>  implements MusicGroupPaymentEntitiesService {
	
	@Autowired
	private MusicGroupPaymentEntitiesDao musicGroupPaymentEntitiesDao;

	@Override
	public BaseDAO<Integer, MusicGroupPaymentEntities> getDAO() {
		return musicGroupPaymentEntitiesDao;
	}

	@Override
	@Transactional(rollbackFor = Exception.class)
	public void batchInsert(List<MusicGroupPaymentEntities> musicGroupPaymentEntities) {
		musicGroupPaymentEntities.forEach(e -> {
			musicGroupPaymentEntitiesDao.insert(e);
		});
	}
}