Loading

摘要: 计算字符串"code"的哈希值 ASCII值 A = 65 Z = 90, a = 97 z = 122 c = 99 o = 111 d = 100 e =101 参考计算公式:s [0] * 31 ^(n-1)+ s [1] * 31 ^(n-2)+ ... + s [n-1] 得 99 * 3 阅读全文
posted @ 2020-08-04 20:27 codeduck 阅读(403) 评论(0) 推荐(0)
摘要: PS:所有示例中的userService接口 为 IUserService继承了MP中的 IService 1. QueryWrapper 说明: 继承自 AbstractWrapper ,自身的内部属性 entity 也用于生成 where 条件 及 LambdaQueryWrapper, 可以通 阅读全文
posted @ 2020-08-04 15:58 codeduck 阅读(34963) 评论(0) 推荐(3)
摘要: IService介绍接口 使用MybatisPlus代码生成器自动生成IUserService接口并继承IService 查看IService接口已经封装了诸多方法 并由ServiceImpl继承并实现 public class ServiceImpl<M extends BaseMapper<T> 阅读全文
posted @ 2020-08-04 11:15 codeduck 阅读(3190) 评论(0) 推荐(0)
摘要: Supplier接口 Supplier接口源码 该接口是一个提供者的意思,只有一个 get() 方法 当传入一个泛型T对象,则可使用 get()方法返回 该对象实例的引用 @FunctionalInterface public interface Supplier<T> { /** * Gets a 阅读全文
posted @ 2020-08-04 08:24 codeduck 阅读(447) 评论(0) 推荐(0)
摘要: Java8可以使用一对冒号:: 来实现对方法引用 其语法有 **构造器引用:**它的语法是Class::new,或者更一般的Class< T >::new **静态方法引用:**它的语法是Class::static_method **特定对象的方法引用:**它的语法是instance::method 阅读全文
posted @ 2020-08-04 07:55 codeduck 阅读(929) 评论(0) 推荐(0)