日期:2014-05-20 浏览次数:20863 次
Session s = empeelyDao.getSession();
Empeely emp = (Empeely)s.get(Empeely.class,1);
System.out.println(emp.getName());
Statistics ss = s.getSessionFactory().getStatistics();
System.out.println(ss);
s.close();
Session sss = empeelyDao.getSession();
Empeely emp1 = (Empeely)sss.get(Empeely.class,1);
sss.close();
Statistics ss1 = s.getSessionFactory().getStatistics();
System.out.println(ss1);
System.out.println(emp1.getName());
skill
Statistics[start time=1350062954436,sessions opened=3,sessions closed=2,transactions=2,successful transactions=2,optimistic lock failures=0,flushes=2,connections obtained=3,statements prepared=5,statements closed=5,second level cache puts=0,second level cache hits=0,second level cache misses=0,entities loaded=1,entities updated=0,entities inserted=2,entities deleted=0,entities fetched=0,collections loaded=0,collections updated=0,collections removed=0,collections recreated=0,collections fetched=0,queries executed to database=0,query cache puts=0,query cache hits=0,query cache misses=0,max query time=0]
Hibernate: select empeely0_.id as id0_0_, empeely0_.firstCard as firstCard0_0_, empeely0_.endCard as endCard0_0_, empeely0_.name as name0_0_, empeely0_1_.skills as skills1_0_, empeely0_2_.yeji as yeji2_0_, case when empeely0_1_.empeely_id is not null then 1 when empeely0_2_.empeely_id is not null then 2 when empeely0_.id is not null then 0 end as clazz_0_ from empeely empeely0_ left outer join skiller empeely0_1_ on empeely0_.id=empeely0_1_.empeely_id left outer join xiaoshou empeely0_2_ on empeely0_.id=empeely0_2_.empeely_id where empeely0_.id=?