我有以下的hibernate查询: Query query = session.createQuery("from MyHibernateClass"); List<MyHibernateClass> result = query.list();// executes in 7000ms logging在MySQL中执行的SQL我看到 select myhibernat0_.myFirstColumn as myfirstcolumn92_, myhibernat0_.mySecondColumn as mysecondcolumn92_, myhibernat0_.mythirdcolumn as mythirdcolumn92_, myhibernat0_.myFourthColumn as myfourthcolumn92_ from MyHibernateClass myhibernat0_ where (1=1); 当在MyHibernateClass数据库表中的3500行的小数据集中测量jvm中的java代码时,大约需要7000ms。 如果我另一方面使用直接jdbc,如下所示: Statement statement = session.connection().createStatement(); ResultSet rs = statement.executeQuery("select * from MyHibernateClass");// 7ms List<MyHibernateClass> result = convert(rs);// executes in 20ms 我看到相同的数据库进入数据库,但现在花费在jvm中的java代码的时间是7ms。 MyHibernateClass是一个简单的带有getter和setter的java […]