Idea工具常用快捷键 Posted on 11月 20, 2019 by admin 优化 import java classes //消除不用的 import classes Shift+Command + A , then Enter Find java file Control + Shift + O Find keyword in projects Control + Shift + F
用java JPA进行多表join Posted on 11月 14, 201911月 14, 2019 by admin 例如我们有如下多表查询 select A.id, A.name, B.name2, C.name2 from A,B,C where A.id=B.bid and B.name3 = C.id 我们用Join连接 JPA tables // Root rootpath Entity A,B,C in B has relasionship B.name3 = C Join b_path = rootpath.join("id"); Join c_path = b_path.join("name3");
Java 小知识 Posted on 11月 14, 201911月 14, 2019 by admin 1. Get client timezone Calendar.getInstance().getTimeZone() 2. JPA sql 输出 //queryType:TypedQuery System.out.println(queryType.unwrap(org.eclipse.persistence.jpa.JpaQuery.class).getDatabaseQuery().getSQLString()); 3. LocalDateTime to Date //local_time : LocalDateTime Date.from( local_time.atZone( ZoneId.systemDefault()).toInstant());