Package org.hibernate

Examples of org.hibernate.SQLQuery.executeUpdate()


      for(int i=0; i< params.length; i++){
        logger.debug("{}) : {} [{}]", new Object[]{i+1, params[i], types[i]});
        query.setParameter(i, params[i], types[i]);
      }
    }   
    return query.executeUpdate();
  }

  public void executeDDL(String queryString) {
    Session session = getSession();
    SQLQuery query = session.createSQLQuery(queryString);
View Full Code Here


  }

  public void executeDDL(String queryString) {
    Session session = getSession();
    SQLQuery query = session.createSQLQuery(queryString);
    query.executeUpdate();
 
 
  private class InnerStoreProcedure extends StoredProcedure {
      public InnerStoreProcedure(String spName, SqlParameter[] parameters){
        setSql(spName);
View Full Code Here

  public int delete(String sql, Object... ids)
  {
    prepareSession(true);

    SQLQuery query = preparedSqlQuery(sql, ids);
    int count = query.executeUpdate();

    relaseSession(true);
    return count;
  }
View Full Code Here

                    for (int i = 0; i < values.length; i++) {
                        queryObject.setParameter(i, values[i]);
                    }
                }

                return queryObject.executeUpdate();
            }
        });
    }

   
View Full Code Here

   * @author "Nico Naumann"
   */
  private void flush() {
    SQLQuery sqlq; 
    sqlq = this.session.createSQLQuery("truncate modelelements, abstractnodes, circlelocations, connections, edge_node, edgelocations, edges, environmentevents, event_lane, events, lanes, location_edge, locations, nodes, pointsofinterest, polygonlocations, polygonpoints, roadevents, tldurations, trafficlight_edge_tlsl, trafficlights, trafficlightstatelistentries, trafficlightstatelists, way_trafficlight, ways;");
    sqlq.executeUpdate();
    this.session.clear();
  }

  /**
   * Loads a persisted data model from the associated data base. Before this is done, all
View Full Code Here

      {
        i++;
        this.session = this.sessionFactory.getCurrentSession();
        Transaction tx = this.session.beginTransaction();
        SQLQuery q = this.session.createSQLQuery(sql);
        q.executeUpdate();
        tx.commit();
        this.notifyObservers(new ObserverNotification(NotificationType.updateSignal, (int)(((double)i/(double)queriesSize) * 100.0)));

     
      this.notifyObservers(new ObserverNotification(NotificationType.updateSignal, 100));
View Full Code Here

            contactQuery1.executeUpdate();
            contactQuery2.executeUpdate();
            contactQuery3.executeUpdate();
            emailQuery1.executeUpdate();
            emailQuery2.executeUpdate();
            emailQuery3.executeUpdate();
            session.getTransaction().commit();
        } finally {
            if (null != session) {
                session.close();
            }
View Full Code Here

            SQLQuery deleteContacts = session.createSQLQuery("delete from CONTACTS");
            SQLQuery deleteUsers = session.createSQLQuery("delete from USERS");

            deleteEmails.executeUpdate();
            deleteContacts.executeUpdate();
            deleteUsers.executeUpdate();
            session.getTransaction().commit();
        } finally {
            if (null != session) {
                session.close();
            }
View Full Code Here

            SQLQuery contactQuery2 = session.createSQLQuery(
                    "insert into CONTACTS values ('schwarzie@expendables.com', 'Arnold Schwarzenegger', 'miso')");

            userQuery.executeUpdate();
            contactQuery1.executeUpdate();
            contactQuery2.executeUpdate();
            session.getTransaction().commit();
        } finally {
            if (null != session) {
                session.close();
            }
View Full Code Here

        try {
            session.beginTransaction();
            SQLQuery deleteContacts = session.createSQLQuery("delete from CONTACTS");
            SQLQuery deleteUsers = session.createSQLQuery("delete from USERS");
            deleteContacts.executeUpdate();
            deleteUsers.executeUpdate();
            session.getTransaction().commit();
        } finally {
            if (null != session) {
                session.close();
            }
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.