Package javax.persistence

Examples of javax.persistence.Query.executeUpdate()


         
      if(shapeId != null)
          q.setParameter(10,  shapeId);
     
         
          q.executeUpdate();
    }
    else if(serviceCalendarDateId != null)
    {
Query q;
     
View Full Code Here


          .setParameter(8,  serviceCalendarDateId);
         
          if(shapeId != null)
            q.setParameter(9,  shapeId);
                 
          q.executeUpdate();
    }
    else
    {
      Logger.error("Missing vaild serivce id for trip " + gtfsTrip.getId().toString());
    }
View Full Code Here

        .setParameter(4,  trip.tripHeadsign);

        if(trip.shape != null)
         q.setParameter(5,  trip.shape.id);

        q.executeUpdate();


      ArrayList<StopTime> stopTimes = trip.getStopTimes();

      Integer previousDepartureTime = 0;
View Full Code Here

          previousDistance = stopTime.shapeDistTraveled;
        }
       
        lastStopName = stopTime.stop.stopName;

        q.executeUpdate();
       
        q = em.createNativeQuery("INSERT INTO trippattern_trippatternstop (trippattern_id, patternstops_id) VALUES (?, ?);");
       
        q.setParameter(1,  tripPatternId.longValue());
        q.setParameter(2,  tripPatternStopId.longValue());
View Full Code Here

        q = em.createNativeQuery("INSERT INTO trippattern_trippatternstop (trippattern_id, patternstops_id) VALUES (?, ?);");
       
        q.setParameter(1,  tripPatternId.longValue());
        q.setParameter(2,  tripPatternStopId.longValue());
       
        q.executeUpdate();
       
           
           
      }
     
View Full Code Here

    @Override
    public int deleteOrphaned() {
        Query query = entityManager.createNamedQuery("ScheduleAction.removeOrphaned");

        return query.executeUpdate();
    }

    @PersistenceContext
    public void setEntityManager(EntityManager entityManager) {
        this.entityManager = entityManager;
View Full Code Here

    @Override
    public int deleteExpired(Date expiration) {
        Query query = entityManager.createNamedQuery("ScheduleExecution.deleteExpired");
        query.setParameter("expiration", expiration);

        return query.executeUpdate();
    }

    @Override
    public int detachJob(long scheduleJobId) {
        Query query = entityManager.createNamedQuery("ScheduleExecution.detachJob");
View Full Code Here

    @Override
    public int detachJob(long scheduleJobId) {
        Query query = entityManager.createNamedQuery("ScheduleExecution.detachJob");
        query.setParameter("scheduleJobId", scheduleJobId);

        return query.executeUpdate();
    }

    @PersistenceContext
    public void setEntityManager(EntityManager entityManager) {
        this.entityManager = entityManager;
View Full Code Here

        String ejbdelUpdate =
            "DELETE  FROM RuntimeTest1 r WHERE r.stringField = ?1";
        Query query = em.createQuery(ejbdelUpdate);

        query.setParameter(1, "runt1");
        int ok = query.executeUpdate();

        assertEquals(1, ok);

        endTx(em);
        endEm(em);
View Full Code Here

        EntityManager em = getEntityManagerProvider().get();
        Query nativeQuery = em.createNativeQuery("UPDATE hostcomponentstate SET current_state=?1 WHERE current_state in (?2, ?3)");
        nativeQuery.setParameter(1, "INSTALLED");
        nativeQuery.setParameter(2, "STOP_FAILED");
        nativeQuery.setParameter(3, "START_FAILED");
        nativeQuery.executeUpdate();
      }
    });

    // HostRoleCommand
    executeInTransaction(new Runnable() {
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.