Package org.hibernate.test.domain

Examples of org.hibernate.test.domain.Item


    @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);
View Full Code Here


    @Test
    public void springRepositoryTest() 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");
View Full Code Here

TOP

Related Classes of org.hibernate.test.domain.Item

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.