@Rollback(false)
public void hqlLoad() throws Exception {
log.debug("Item 저장 - #1");
Item item = new Item();
item.setName("redis");
item.setDescription("redis cache item");
em.persist(item);
em.flush();
em.clear();
log.debug("Item 조회 - #1");
//NOTE: http://docs.jboss.org/hibernate/stable/entitymanager/reference/en/html/objectstate.html#d0e1215
Query query = em.createQuery("select e from Item e where e.id=:id").setParameter("id", item.getId()).setHint("org.hibernate.cacheable", true);
Item loaded = (Item) query.getSingleResult();
assertThat(loaded).isNotNull();
em.clear();
log.debug("Item 조회 - #2");
query = em.createQuery("select e from Item e where e.id=:id").setParameter("id", item.getId()).setHint("org.hibernate.cacheable", true);