1.Hibernate缓存
hibernate有两级缓存,一级缓存又称为“Session的缓存”,二级缓存称为“SessionFactory的缓存”。
Session的缓存是事务范围的缓存(Session对象的生命周期通常对应一个数据库事务或者一个应用事务)。
应用缓存,需要通过Session来进行操作,同时官网提供了@Cache注解。
第二级缓存是可选的,是一个可配置的插件,默认下SessionFactory不会启用这个插件。
2.Hibernate级联操作
级联操作对应的是数据库的外键,可以代替到外键的作用。
https://www.cnblogs.com/hcl22/p/6103254.html
3.Scanner的用法
Scanner scan = new Scanner(System.in); String str = scan.next(); int a = scan.nextInt(); if (scan.hasNextLine()) { String str2 = scan.nextLine(); System.out.println("输入的数据为:" + str2); }
原文:https://www.cnblogs.com/chrisweiii/p/10391157.html