Examples of UpdateQuery


Examples of com.complexible.stardog.api.UpdateQuery

   *
   */
  public void update(String sparql, Map<String, Object> args) {
    Connection connection = dataSource.getConnection();
    try {
      UpdateQuery query = connection.update(sparql);
     
      if (args != null) {
        for (Entry<String, Object> arg : args.entrySet()) {          
          query.parameter(arg.getKey(), arg.getValue());
        }
      }

      query.execute();

    } catch (StardogException e) {
      log.error("Error sending query to Stardog", e);
      throw new RuntimeException(e);
    } finally {
View Full Code Here

Examples of net.datacrow.core.db.UpdateQuery

                addRequest(new UpdateUIAfterUpdateRequest(this, isLastInLine()));
           
            if (queued) {
              WorkFlow.update(this);
            } else {
                new UpdateQuery(this).run();
            }
        } catch (ValidationException exp) {
            executeRequests(false);
            throw exp;
        } catch (Exception e) {
View Full Code Here

Examples of nl.giantit.minecraft.database.query.UpdateQuery

    return sQ.select(fields);
  }
 
  @Override
  public UpdateQuery update(String table) {
    UpdateQuery uQ = new MySQLUpdateQuery(this);
    uQ.setTable(table);
   
    return uQ;
  }
View Full Code Here

Examples of org.apache.cayenne.query.UpdateQuery

    /**
     * Helper method to update a single column in a database row.
     */
    protected void updateRow(ObjectId id, String dbAttribute, Object newValue) {
        UpdateQuery updateQuery = new UpdateQuery();
        updateQuery.setRoot(id.getEntityName());
        updateQuery.addUpdAttribute(dbAttribute, newValue);

        // set qualifier
        updateQuery.setQualifier(ExpressionFactory.matchAllDbExp(
                id.getIdSnapshot(),
                Expression.EQUAL_TO));

        getDomain().onQuery(null, updateQuery);
    }
View Full Code Here

Examples of se.unlogic.standardutils.dao.querys.UpdateQuery

      }
     
      for(RemoteType remoteBean : remoteBeans){
     
        //Set new relations
        UpdateQuery insertQuery;
       
        insertQuery = new UpdateQuery(connection, false, linkTableInsertSQL);
       
        setQueryParameter(insertQuery, this.localColumn, bean, 1);
        setQueryParameter(insertQuery, this.remoteColumn, remoteBean, 2);
       
        insertQuery.executeUpdate();
      }
     
    } catch (IllegalArgumentException e) {

      throw new RuntimeException(e);
View Full Code Here

Examples of se.unlogic.standardutils.dao.querys.UpdateQuery

      if(!initialized){
        init()
      }
     
      //Clear old relations
      UpdateQuery deleteQuery;
     
      deleteQuery = new UpdateQuery(connection, false, linkTableDeleteSQL);
     
      setQueryParameter(deleteQuery, this.localColumn, bean, 1);
     
      deleteQuery.executeUpdate();
     
      //Check if there are any new relations to set
      List<RemoteType> remoteBeans = (List<RemoteType>) field.get(bean);
     
      if(remoteBeans == null){
       
        return;
      }
     
      for(RemoteType remoteBean : remoteBeans){
     
        //Set new relations
        UpdateQuery insertQuery;
       
        insertQuery = new UpdateQuery(connection, false, linkTableInsertSQL);
       
        setQueryParameter(insertQuery, this.localColumn, bean, 1);
        setQueryParameter(insertQuery, this.remoteColumn, remoteBean, 2);
       
        insertQuery.executeUpdate();
      }
     
    } catch (IllegalArgumentException e) {

      throw new RuntimeException(e);
View Full Code Here

Examples of se.unlogic.standardutils.dao.querys.UpdateQuery

  }
 
  public void executeScript(String script) throws SQLException {

    TransactionHandler transactionHandler = null;
    UpdateQuery updateQuery;

    ScriptUtility scriptUtility = new MySQLScriptUtility();
    List<String> statements = scriptUtility.getStatements(script);
   
    try {
     
      transactionHandler = new TransactionHandler(this.dataSource);

      for(String query : statements) {
        updateQuery = transactionHandler.getUpdateQuery(query.toString());
        updateQuery.executeUpdate();
      }
     
      transactionHandler.commit();

    } finally {
View Full Code Here

Examples of se.unlogic.standardutils.dao.querys.UpdateQuery

        int listIndex = 0;
       
        for (RemoteType value : values) {

          UpdateQuery query = new UpdateQuery(connection, false, insertSQL);

          setKey(query, bean);

          setValue(value, query);

          if(preserveListOrder){
           
            query.setInt(3, listIndex);
            listIndex++;
          }
         
          query.executeUpdate();
        }
      }

    } catch (IllegalArgumentException e) {
View Full Code Here

Examples of se.unlogic.standardutils.dao.querys.UpdateQuery

    if (!initialized) {
      init();
    }

    UpdateQuery query = new UpdateQuery(connection, false, deleteSQL);

    setKey(query, bean);

    query.executeUpdate();

    this.add(bean, connection, relationQuery);
  }
View Full Code Here

Examples of se.unlogic.standardutils.dao.querys.UpdateQuery

  public UpdateQuery getUpdateQuery(String sqlExpression) throws SQLException {

    this.checkStatus();

    UpdateQuery query = new UpdateQuery(connection, false, sqlExpression);

    checkQueryList();
   
    this.queryList.add(query);
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.