public void testQueryCache() {
		Session session = null;
		try {
			/**
			 * 此时会发出一条sql取出所有的用户信息
			 */
			session = getCurrentSession();
			List<User> ls = session.createQuery("from User").setCacheable(true) // 开启查询缓存
					.setFirstResult(0).setMaxResults(10).list();
			Iterator<User> users = ls.iterator();
			for (; users.hasNext();) {
				User user = users.next();
				System.out.println(user.getUsername());
			}
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			session.close();
		}
		try {
			/**
			 * 此时只会发出一条sql取出所有的用户信息
			 */
			session = sessionFactory.openSession();
			List<User> ls = session.createQuery("from User").setCacheable(true) // 启用查询缓存
					.setFirstResult(0).setMaxResults(10).list();
			Iterator<User> users = ls.iterator();
			for (; users.hasNext();) {
				User user = users.next();
				System.out.println(user.getUsername());
			}
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			session.close();
		}
	}