摘要: public interface UserCrudRepository extends CrudRepository<User, Long> {}12UserCrudRepositoryTests: @RunWith(SpringRunner.class)@SpringBootTestpublic 阅读全文
posted @ 2019-08-13 17:06 李艳艳665 阅读(168) 评论(0) 推荐(0) 编辑
摘要: /** * 他是具有分页和排序的功能 同时继承了 CrudRepository */public interface UserPageRepository extends PagingAndSortingRepository<User,Long> {}12345UserPageRepositoryT 阅读全文
posted @ 2019-08-13 17:06 李艳艳665 阅读(106) 评论(0) 推荐(0) 编辑
摘要: /** * 不仅继承了 PagingAndSortingRepository 同时继承了 QueryByExampleExecutor(示例匹配器) */public interface UserJpaRepository extends JpaRepository<User, Long> {}12 阅读全文
posted @ 2019-08-13 17:06 李艳艳665 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 步骤: 创建线程池对象创建 Callable 接口子类对象提交 Callable 接口子类对象关闭线程池实例: class TaskCallable implements Callable<Integer> { @Override public Integer call() throws Excep 阅读全文
posted @ 2019-08-13 17:05 李艳艳665 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 题意:建立三个线程,A线程打印10次A,B线程打印10次B,C线程打印10次C,要求线程同时运行,交替打印10次ABC。这个问题用Object的wait(),notify()就可以很方便的解决。 代码如下: public class MyThreadPrinter2 implements Runna 阅读全文
posted @ 2019-08-13 17:05 李艳艳665 阅读(112) 评论(0) 推荐(0) 编辑