Package org.hibernate.ejb

Examples of org.hibernate.ejb.HibernateEntityManager


        return criteria.list();
    }

    @Override
    public List<YFTheme> getUnassignedDishThemes(long id) {
        HibernateEntityManager hem = (HibernateEntityManager) em.getDelegate();
        Criteria criteria = hem.getSession().createCriteria(YFTheme.class);

        List<YFTheme> themes = getAssignedDishThemes(id);
        // Evite une erreur de synthaxe SQL...
        if (themes.isEmpty()) {
            return getAllThemes();
View Full Code Here


    @PersistenceContext
    protected EntityManager em;

    @Override
    public List<YFTable> getTables(long restaurantId) {
        HibernateEntityManager hem = (HibernateEntityManager) em.getDelegate();
        Criteria criteria = hem.getSession().createCriteria(YFTable.class);

        criteria.add(Restrictions.eq("restaurant.id", restaurantId));
        return criteria.list();
    }
View Full Code Here

        return criteria.list();
    }

    @Override
    public YFTable getTable(long tableId, long restaurantId) {
        HibernateEntityManager hem = (HibernateEntityManager) em.getDelegate();
        Criteria criteria = hem.getSession().createCriteria(YFTable.class);

        criteria.add(Restrictions.eq("restaurant.id", restaurantId));
        criteria.add(Restrictions.eq("id", tableId));
        return (YFTable) criteria.uniqueResult();
    }
View Full Code Here

        em.merge(table);
    }

    @Override
    public List<YFTable> getAreaTables(YFArea area) {
        HibernateEntityManager hem = (HibernateEntityManager) em.getDelegate();
        Criteria criteria = hem.getSession().createCriteria(YFTable.class);

        criteria.add(Restrictions.eq("area.id", area.getId()));
        return criteria.list();
    }
View Full Code Here

        return criteria.list();
    }

    @Override
    public List<YFTable> getFreeTables(YFArea area) {
        HibernateEntityManager hem = (HibernateEntityManager) em.getDelegate();
        Criteria criteria = hem.getSession().createCriteria(YFTable.class);

        criteria.add(Restrictions.eq("state", YFTableState.AVAILABLE));
        criteria.add(Restrictions.eq("area.id", area.getId()));
        return criteria.list();
    }
View Full Code Here

        return criteria.list();
    }

    @Override
    public Integer getNumberUsedTables() {
        HibernateEntityManager hem = (HibernateEntityManager) em.getDelegate();
        Criteria criteria = hem.getSession().createCriteria(YFTable.class);

        criteria.add(Restrictions.eq("state", YFTableState.UNAVAILABLE));

        try {
            return criteria.list().size();
View Full Code Here

        }
    }

    @Override
    public YFTable getTable(String tableName, String restaurantName) {
        HibernateEntityManager hem = (HibernateEntityManager) em.getDelegate();
        Criteria criteria = hem.getSession().createCriteria(YFTable.class);
       
        criteria.createAlias("restaurant", "r")
                .add(Restrictions.eq("r.name", restaurantName))
                .add(Restrictions.eq("name", tableName));
       
View Full Code Here

    assertTrue(emfi.getNativeEntityManagerFactory() instanceof HibernateEntityManagerFactory);
  }

  public void testCanCastSharedEntityManagerProxyToHibernateEntityManager() {
    assertTrue(sharedEntityManager instanceof HibernateEntityManager);
    HibernateEntityManager hibernateEntityManager = (HibernateEntityManager) sharedEntityManager;
    assertNotNull(hibernateEntityManager.getSession());
  }
View Full Code Here

    assertTrue(emfi.getNativeEntityManagerFactory() instanceof HibernateEntityManagerFactory);
  }

  public void testCanCastSharedEntityManagerProxyToHibernateEntityManager() {
    assertTrue(sharedEntityManager instanceof HibernateEntityManager);
    HibernateEntityManager hibernateEntityManager = (HibernateEntityManager) sharedEntityManager;
    assertNotNull(hibernateEntityManager.getSession());
  }
View Full Code Here

    @PersistenceContext
    protected EntityManager em;

    @Override
    public List<YFPlanning> getAreaPlanning(YFArea area) {
        HibernateEntityManager hem = (HibernateEntityManager) em.getDelegate();
        Criteria criteria = hem.getSession().createCriteria(YFPlanning.class);
        criteria.add(Restrictions.eq("area.id", area.getId()));

        return criteria.list();
    }
View Full Code Here

TOP

Related Classes of org.hibernate.ejb.HibernateEntityManager

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.