Examples of createQuery()


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

                Persistence.createEntityManagerFactory("test", props));
       
        EntityManagerImpl em = (EntityManagerImpl)emf.createEntityManager();

        em.getTransaction().begin();
        em.createQuery("Delete from TblGrandChild").executeUpdate();
        em.createQuery("Delete from TblChild").executeUpdate();
        em.createQuery("Delete from TblParent").executeUpdate();
        em.getTransaction().commit();
        em.close();
       
View Full Code Here

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

    }

    public void testBulkDelete() {
        OpenJPAEntityManager em = emf.createEntityManager();
        em.getTransaction().begin();
        List result = em.createQuery("SELECT o FROM AllFieldTypes o")
            .getResultList();
        assertEquals(1, result.size());
        em.createQuery("DELETE FROM AllFieldTypes o").executeUpdate();
        em.getTransaction().commit();
        em.close();
View Full Code Here

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

        sql.clear();
        try {
            em.getTransaction().begin();
            if (hint || queryHint) {
                if (hint) {
                    Query q = em.createQuery(
                    "select o from AllFieldTypes o where o.intField = :p");
                    q.setParameter("p", 0);
                    q.setHint("openjpa.hint.OptimizeResultCount"
                         ,new Integer(8));
                    q.getResultList();
View Full Code Here

Examples of org.easycassandra.persistence.cassandra.FixKeySpaceUtil.CreateKeySpace.createQuery()

    public void createKeySpace(KeySpaceQueryInformation information, Session session) {

        CreateKeySpace createKeySpace = FixKeySpaceUtil.INSTANCE
                .getCreate(information.getReplicaStrategy());
        try {
            session.execute(createKeySpace.createQuery(information));
        } catch (InvalidQueryException exception) {
            error(information, createKeySpace, exception);
        }
    }
View Full Code Here

Examples of org.eclipse.ocl.ecore.OCL.Helper.createQuery()

     
      EAnnotation ocl = eFeature.getEAnnotation(OCL_ANNOTATION_SOURCE);
      String derive = (String) ocl.getDetails().get("derive");
     
      try {
        attributeDeriveOCL = helper.createQuery(derive);
      } catch (ParserException e) {
        throw new UnsupportedOperationException(e.getLocalizedMessage());
      }
    }
   
View Full Code Here

Examples of org.eclipse.ocl.helper.OCLHelper.createQuery()

      }
      if (oclQuery == null) {
        OCLHelper oclHelper = oclInstance.createOCLHelper();
        oclHelper.setContext(context());
        try {
          OCLExpression oclExpression = oclHelper.createQuery(body());
          oclQuery = oclInstance.createQuery(oclExpression);
          this.queryRef = new WeakReference(oclQuery);
          setStatus(IStatus.OK, null, null);
        } catch (ParserException e) {
          setStatus(IStatus.ERROR, e.getMessage(), e);
View Full Code Here

Examples of org.eclipse.search.ui.text.TextSearchQueryProvider.createQuery()

            TextSearchQueryProvider queryProvider = TextSearchQueryProvider.getPreferred();
            IJavaProject currentJavaProject = theController.getCurrentProject();
            if (currentJavaProject == null) return;
           
            IResource currentProject = currentJavaProject.getResource();
            ISearchQuery query = queryProvider.createQuery(text, asArray(currentProject));
            NewSearchUI.runQueryInBackground(query);
            query.getSearchResult().addListener(resultListener);
        } catch (CoreException e) {
            Log.error(e);
        }
View Full Code Here

Examples of org.geoserver.wfs.request.GetFeatureRequest.createQuery()

        //match up sizes
        if (m > n) {
            if (n == 0) {
                //make same size, with empty objects
                for (int i = 0; i < m; i++) {
                    query.add(req.createQuery().getAdaptee());
                }
            } else if (n == 1) {
                //clone single object up to
                EObject q = (EObject) query.get(0);
View Full Code Here

Examples of org.gephi.filters.api.FilterController.createQuery()

        if (builder != null) {
            //Create filter
            Filter filter = builder.getFilter();
            FilterController fc = Lookup.getDefault().lookup(FilterController.class);
            Query query = fc.createQuery(filter);

            FilterProperty property = null;
            boolean end = false;
            while (reader.hasNext() && !end) {
                Integer eventType = reader.next();
View Full Code Here

Examples of org.hibernate.Session.createQuery()

   
    @SuppressWarnings("unchecked")
  public static List<ProcessInstanceLog> findProcessInstances() {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        List<ProcessInstanceLog> result = session.createQuery("from ProcessInstanceLog").list();
        session.getTransaction().commit();
        return result;
    }

    @SuppressWarnings("unchecked")
View Full Code Here
TOP
Copyright © 2015 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.