io.mybatis.mapper.logical.LogicalMapper Maven / Gradle / Ivy
The newest version!
package io.mybatis.mapper.logical;
import io.mybatis.mapper.BaseMapper;
import io.mybatis.mapper.example.Example;
import io.mybatis.mapper.fn.Fn;
import io.mybatis.mapper.fn.FnMapper;
import io.mybatis.provider.Caching;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.cursor.Cursor;
import org.apache.ibatis.session.RowBounds;
import java.io.Serializable;
import java.util.List;
import java.util.Optional;
/**
* 逻辑删除的 Mapper 方法
* 继承此mapper会覆盖BaseMapper、FnMapper中的查、删、改相关方法
*
* @author hzw
*/
public interface LogicalMapper extends BaseMapper, FnMapper {
/* BaseMapper +++ */
@Override
@Lang(Caching.class)
@UpdateProvider(type = LogicalProvider.class, method = "updateByPrimaryKeySelectiveWithForceFields")
int updateByPrimaryKeySelectiveWithForceFields(@Param("entity") S entity, @Param("fns") Fn.Fns forceUpdateFields);
/* BaseMapper --- */
/* FnMapper +++ */
@Override
@Lang(Caching.class)
@SelectProvider(type = LogicalProvider.class, method = "selectColumns")
Optional selectColumnsOne(@Param("entity") T entity, @Param("fns") Fn.Fns selectFields);
@Override
@Lang(Caching.class)
@SelectProvider(type = LogicalProvider.class, method = "selectColumns")
List selectColumns(@Param("entity") T entity, @Param("fns") Fn.Fns selectFields);
/* FnMapper --- */
/* EntityMapper +++ */
@Override
@Lang(Caching.class)
@DeleteProvider(type = LogicalProvider.class, method = "deleteByPrimaryKey")
int deleteByPrimaryKey(I id);
@Override
@Lang(Caching.class)
@DeleteProvider(type = LogicalProvider.class, method = "delete")
int delete(T entity);
@Override
@Lang(Caching.class)
@UpdateProvider(type = LogicalProvider.class, method = "updateByPrimaryKey")
int updateByPrimaryKey(S entity);
@Override
@Lang(Caching.class)
@UpdateProvider(type = LogicalProvider.class, method = "updateByPrimaryKeySelective")
int updateByPrimaryKeySelective(S entity);
@Override
@Lang(Caching.class)
@SelectProvider(type = LogicalProvider.class, method = "selectByPrimaryKey")
Optional selectByPrimaryKey(I id);
@Override
@Lang(Caching.class)
@SelectProvider(type = LogicalProvider.class, method = "select")
Optional selectOne(T entity);
@Override
@Lang(Caching.class)
@SelectProvider(type = LogicalProvider.class, method = "select")
List selectList(T entity);
@Override
@Lang(Caching.class)
@SelectProvider(type = LogicalProvider.class, method = "selectCount")
long selectCount(T entity);
/* EntityMapper --- */
/* CursorMapper +++ */
@Override
@Lang(Caching.class)
@SelectProvider(type = LogicalProvider.class, method = "select")
Cursor selectCursor(T entity);
@Override
@Lang(Caching.class)
@SelectProvider(type = LogicalProvider.class, method = "selectByExample")
Cursor selectCursorByExample(Example example);
/* CursorMapper --- */
/* ExampleMapper +++ */
@Override
default Example example() {
return BaseMapper.super.example();
}
@Override
@Lang(Caching.class)
@DeleteProvider(type = LogicalProvider.class, method = "deleteByExample")
int deleteByExample(Example example);
@Override
@Lang(Caching.class)
@UpdateProvider(type = LogicalProvider.class, method = "updateByExample")
int updateByExample(@Param("entity") S entity, @Param("example") Example example);
@Override
@Lang(Caching.class)
@UpdateProvider(type = LogicalProvider.class, method = "updateByExampleSetValues")
int updateByExampleSetValues(@Param("example") Example example);
@Override
@Lang(Caching.class)
@UpdateProvider(type = LogicalProvider.class, method = "updateByExampleSelective")
int updateByExampleSelective(@Param("entity") S entity, @Param("example") Example example);
@Override
@Lang(Caching.class)
@SelectProvider(type = LogicalProvider.class, method = "selectByExample")
List selectByExample(Example example);
@Override
@Lang(Caching.class)
@SelectProvider(type = LogicalProvider.class, method = "selectByExample")
Optional selectOneByExample(Example example);
@Override
@Lang(Caching.class)
@SelectProvider(type = LogicalProvider.class, method = "countByExample")
long countByExample(Example example);
@Override
List selectByExample(Example example, RowBounds rowBounds);
/* ExampleMapper --- */
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy