package cn.estsh.i3plus.ext.mes.pcn.pojo.repository;

import cn.estsh.i3plus.ext.mes.pcn.pojo.bean.MesOutPutStatistics;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
import org.springframework.data.jpa.repository.Lock;
import org.springframework.stereotype.Repository;

import javax.persistence.LockModeType;
import java.util.List;

/**
 * @author wangjie
 * @version 1.0
 * @date 2021/1/13 9:17
 **/
@Repository
public interface MesOutPutStatisticsWithPessimisticLockRepository extends BaseRepository<MesOutPutStatistics, Long> {

    @Lock(value = LockModeType.PESSIMISTIC_READ)
    @Override
    List<MesOutPutStatistics> findByProperty(String propertyName, Object value);

    @Lock(value = LockModeType.PESSIMISTIC_READ)
    @Override
    List<MesOutPutStatistics> findByProperty(String[] propertyNames, Object[] values);

    @Lock(value = LockModeType.PESSIMISTIC_READ)
    @Override
    List<MesOutPutStatistics> findByProperty(String propertyName, Object value, String orderByStuff);

    @Lock(value = LockModeType.PESSIMISTIC_READ)
    @Override
    List<MesOutPutStatistics> findByProperty(String[] propertyNames, Object[] values, String orderByStuff);

    @Lock(value = LockModeType.PESSIMISTIC_READ)
    @Override
    MesOutPutStatistics getByProperty(DdlPackBean packBean);

    @Lock(value = LockModeType.PESSIMISTIC_READ)
    @Override
    MesOutPutStatistics getByProperty(String propertyName, Object value);

    @Lock(value = LockModeType.PESSIMISTIC_READ)
    @Override
    MesOutPutStatistics getByProperty(String[] propertyNames, Object[] values);

    @Lock(value = LockModeType.PESSIMISTIC_READ)
    @Override
    List<MesOutPutStatistics> findByHqlWhere(DdlPackBean packBean);

    @Lock(value = LockModeType.PESSIMISTIC_READ)
    @Override
    List<MesOutPutStatistics> findByHqlWhere(String hqlWhere, String[] propertyNames, Object[] values, String orderByStuff);

    @Lock(value = LockModeType.PESSIMISTIC_READ)
    @Override
    int findByHqlCount(String hql);

    @Lock(value = LockModeType.PESSIMISTIC_READ)
    @Override
    int findByHqlCount(String hql, String[] paramName, Object[] paramValue);
}
