Examples of createNamedQuery()


Examples of javax.persistence.EntityManager.createNamedQuery()

   public Query createNamedQuery(String name)
   {
      EntityManager em = getEntityManager();
      if (!factory.isInTx()) em.clear(); // em will be closed by interceptor
      return em.createNamedQuery(name);
   }

   public Query createNativeQuery(String sqlString)
   {
      EntityManager em = getEntityManager();
View Full Code Here

Examples of org.apache.openjpa.persistence.EntityManagerImpl.createNamedQuery()

    }
   
    @Override
    public String getQueryStringOfNamedQuery(String queryName) {
        EntityManagerImpl entityManagerImpl = (EntityManagerImpl) getEntityManager().getDelegate();
        return entityManagerImpl.createNamedQuery(queryName).getQueryString();
    }
   
}
View Full Code Here

Examples of org.apache.openjpa.persistence.OpenJPAEntityManager.createNamedQuery()

        em.getTransaction().begin();
        assertClauseAbsentInSQL(lockClause, em.createNamedQuery("findEmployeeById").setParameter("id", 0));
        assertClauseAbsentInSQL(lockClause, em.createNamedQuery("findEmployeeById").setParameter("id", 0));
       
        OpenJPAEntityManager oem = (OpenJPAEntityManager)em;
        OpenJPAQuery<?> q = oem.createNamedQuery("findEmployeeById").setParameter("id", 0);
        FetchPlan fp = q.getFetchPlan();
        fp.setReadLockMode(LockModeType.NONE);

        em.getTransaction().commit();
        em.close();
View Full Code Here

Examples of org.apache.openjpa.persistence.OpenJPAEntityManagerSPI.createNamedQuery()

     */
    public void testForUpdateClauseAbsentInQueryWithFetchPlanNoneLockMode() {
        OpenJPAEntityManagerSPI em = emf.createEntityManager();
        em.getTransaction().begin();
       
        OpenJPAQuery<?> q = em.createNamedQuery("findEmployeeById").setParameter("id", 0);
        FetchPlan fp = q.getFetchPlan();
        fp.setReadLockMode(LockModeType.NONE);
        assertClauseAbsentInSQL(lockClause, q);
       
        q = em.createNamedQuery("findEmployeeByIdWithNoLock").setParameter("id", 0);
View Full Code Here

Examples of org.hibernate.ejb.HibernateEntityManager.createNamedQuery()

      HibernateEntityManager em = getHibernateEntityManager(ctx);

      HibernateRealm realm = getRealm(em, ctx);

      // Check if object with a given name and type is not present already
      List<?> results = em.createNamedQuery("findIdentityObjectByNameAndType")
         .setParameter("realm", realm)
         .setParameter("name", name)
         .setParameter("typeName", identityObjectType.getName())
        .getResultList();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.