Interface SelectByPrimaryKeyMapper<T>
- Type Parameters:
T- 不能为空
- All Known Subinterfaces:
BaseMapper<T>,BaseSelectMapper<T>,Mapper<T>
public interface SelectByPrimaryKeyMapper<T>
通用Mapper接口,其他接口继承该接口即可
需要在Entity类中为主键字段加上@javax.persistence.Id注解,声明主键
否则无法确认实体类哪个属性是主键
这是一个例子,自己扩展时可以参考
- Author:
- liuzh
-
Method Summary
Modifier and TypeMethodDescriptionselectByPrimaryKey(Object key) 根据主键字段进行查询,方法参数必须包含完整的主键属性,查询条件使用等号
-
Method Details
-
selectByPrimaryKey
@SelectProvider(type=BaseSelectProvider.class, method="dynamicSQL") T selectByPrimaryKey(Object key) 根据主键字段进行查询,方法参数必须包含完整的主键属性,查询条件使用等号- Parameters:
key-- Returns:
-