All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ideaaedi.commonmp.service.ServiceImplExt Maven / Gradle / Ivy

There is a newer version: 2100.10.10.LTS17
Show newest version
package com.ideaaedi.commonmp.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.TableInfo;
import com.baomidou.mybatisplus.core.metadata.TableInfoHelper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ideaaedi.commonmp.mapper.BaseMapperExt;
import org.springframework.transaction.annotation.Transactional;

import java.io.Serializable;
import java.util.Collection;

/**
 * 扩展{@link ServiceImpl}
 *
 * @author JustryDeng 
 * @since 2100.8.0
 */
public class ServiceImplExt, T> extends ServiceImpl implements IServiceExt {
    
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean update(Wrapper updateWrapper) {
        TableInfo tableInfo = TableInfoHelper.getTableInfo(entityClass);
        return this.update(tableInfo.newInstance(), updateWrapper);
    }
    
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int forceDeleteById(Serializable id) {
        return getBaseMapper().forceDeleteById(id);
    }
    
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int forceDeleteBatchIds(Collection idList) {
        return getBaseMapper().forceDeleteBatchIds(idList);
    }
    
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int forceDelete(Wrapper queryWrapper) {
        return getBaseMapper().forceDelete(queryWrapper);
    }
    
    @Override
    public T forceGetOne(Wrapper queryWrapper, boolean throwEx) {
        return baseMapper.forceSelectOne(queryWrapper, throwEx);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy