Examples of Update


Examples of org.hibernate.search.indexes.serialization.operations.impl.Update

            safeOperation.getId(),
            safeOperation.getFieldToAnalyzerMap()
        );
      }
      else if ( operation instanceof Update ) {
        Update safeOperation = ( Update ) operation;
        buildLuceneDocument( safeOperation.getDocument(), hydrator );
        hydrator.addUpdateLuceneWork(
            safeOperation.getEntityClassName(),
            safeOperation.getId(),
            safeOperation.getFieldToAnalyzerMap()
        );
      }
    }
  }
View Full Code Here

Examples of org.hibernate.sql.Update

    }
  }

  protected String generateLockString() {
    SessionFactoryImplementor factory = lockable.getFactory();
    Update update = new Update( factory.getDialect() );
    update.setTableName( lockable.getRootTableName() );
    update.setPrimaryKeyColumnNames( lockable.getRootTableIdentifierColumnNames() );
    update.setVersionColumnName( lockable.getVersionColumnName() );
    update.addColumn( lockable.getVersionColumnName() );
    if ( factory.getSettings().isCommentsEnabled() ) {
      update.setComment( lockMode + " lock " + lockable.getEntityName() );
    }
    return update.toStatementString();
  }
View Full Code Here

Examples of org.jrest4guice.persistence.ibatis.annotations.Update

      StringBuffer statementSb) {
    Method[] methods = clazz.getDeclaredMethods();
    Statement statement;
    Procedure procedure;
    Select select;
    Update update;
    Insert insert;
    Delete delete;
    for (Method method : methods) {
      if (method.isAnnotationPresent(Statement.class)) {
        statement = method.getAnnotation(Statement.class);
        generateMethodSqlMapping(statementSb, "statement", method,
            statement.id(), statement.parameterMap(), statement
                .parameterClass(), statement.resltMap(),
            statement.resltClass(), statement.sql(), statement
                .cacheModel(), statement.xmlResultName());
      } else if (method.isAnnotationPresent(Procedure.class)) {
        procedure = method.getAnnotation(Procedure.class);
        generateMethodSqlMapping(statementSb, "procedure", method,
            procedure.id(), procedure.parameterMap(), procedure
                .parameterClass(), procedure.resltMap(),
            procedure.resltClass(), procedure.sql(), null,
            procedure.xmlResultName());
      } else if (method.isAnnotationPresent(Select.class)) {
        select = method.getAnnotation(Select.class);
        generateMethodSqlMapping(statementSb, "select", method, select
            .id(), select.parameterMap(), select.parameterClass(),
            select.resltMap(), select.resltClass(), select.sql(),
            select.cacheModel(), null);
      } else if (method.isAnnotationPresent(Update.class)) {
        update = method.getAnnotation(Update.class);
        generateMethodSqlMapping(statementSb, "update", method, update
            .id(), null, update.parameterClass(), null, Null.class,
            update.sql(), null, null);
      } else if (method.isAnnotationPresent(Insert.class)) {
        insert = method.getAnnotation(Insert.class);
        generateMethodSqlMapping(statementSb, "insert", method, insert
            .id(), null, insert.parameterClass(), null, Null.class,
            insert.sql(), null, null);
View Full Code Here

Examples of org.keycloak.connections.mongo.updater.updates.Update

                }
            }

            List<Update> updatesToRun = new LinkedList<Update>();
            for (Class<? extends Update> updateClass : updates) {
                Update u = updateClass.newInstance();
                if (!executed.contains(u.getId())) {
                    updatesToRun.add(u);
                }
            }

            if (!updatesToRun.isEmpty()) {
                if (executed.isEmpty()) {
                    log.info("Initializing database schema");
                } else {
                    if (log.isDebugEnabled()) {
                        log.infov("Updating database from {0} to {1}", executed.get(executed.size() - 1), updatesToRun.get(updatesToRun.size() - 1).getId());
                    } else {
                        log.debugv("Updating database");
                    }
                }

                int order = executed.size();
                for (Update u : updatesToRun) {
                    log.debugv("Executing updates for {0}", u.getId());

                    u.setLog(log);
                    u.setDb(db);
                    u.update();

                    createLog(changeLog, u, ++order);

                    log.debugv("Completed updates for {0}", u.getId());
                }
            }
        } catch (Exception e) {
            throw new RuntimeException("Failed to update database", e);
        }
View Full Code Here

Examples of org.lealone.command.dml.Update

        }
        return filter.getTable().getColumn(columnName);
    }

    private Update parseUpdate() {
        Update command = createUpdate(session);
        currentPrepared = command;
        int start = lastParseIndex;
        TableFilter filter = readSimpleTableFilter();
        command.setTableFilter(filter);
        read("SET");
        if (readIf("(")) {
            ArrayList<Column> columns = New.arrayList();
            do {
                Column column = readTableColumn(filter);
                columns.add(column);
            } while (readIf(","));
            read(")");
            read("=");
            Expression expression = readExpression();
            if (columns.size() == 1) {
                // the expression is parsed as a simple value
                command.setAssignment(columns.get(0), expression);
            } else {
                for (int i = 0, size = columns.size(); i < size; i++) {
                    Column column = columns.get(i);
                    Function f = Function.getFunction(database, "ARRAY_GET");
                    f.setParameter(0, expression);
                    f.setParameter(1, ValueExpression.get(ValueInt.get(i + 1)));
                    f.doneWithParameters();
                    command.setAssignment(column, f);
                }
            }
        } else {
            do {
                Column column = readTableColumn(filter);
                read("=");
                Expression expression;
                if (readIf("DEFAULT")) {
                    expression = ValueExpression.getDefault();
                } else {
                    expression = readExpression();
                }
                command.setAssignment(column, expression);
            } while (readIf(","));
        }
        if (readIf("WHERE")) {
            Expression condition = readExpression();
            command.setCondition(condition);
        }
        if (readIf("LIMIT")) {
            Expression limit = readTerm().optimize(session);
            command.setLimit(limit);
        }
        setSQL(command, "UPDATE", start);
        return command;
    }
View Full Code Here

Examples of org.milyn.scribe.annotation.Update

   * @param method
   */
  private void analyzeUpdateMethod(final AnnotatedMethod aMethod) {
    Method method = aMethod.getMethod();

    Update annotation = aMethod.getAnnotation(Update.class);

    String name = annotation.name();
    if(name.length() == 0) {
      name = method.getName();
    }

    assertUniqueName(updateMethods, Update.class, name);

    if(annotation.isDefault() && defaultUpdateMethod != null) {
      throw new IllegalAnnotationUsageException("At least two methods are annotated with the '"+ Update.class.getName() +"' having the isDefault on true. Only one method per class is allowed to be the default update method.");
    }
    if(method.getParameterTypes().length == 0) {
      throw new IllegalAnnotationUsageException("The Update annotated method '"+ method +"' of the DAO class '"+ daoClass.getName() +"' doesn't have any parameters.");
    }
    if(method.getParameterTypes().length > 1) {
      throw new IllegalAnnotationUsageException("The Update annotated method '"+ method +"' of the DAO class '"+ daoClass.getName() +"' has more then 1 parameter, which isn't allowed.");
    }


    boolean returnsEntity  = !method.isAnnotationPresent(ReturnsNoEntity.class);

    EntityMethod updateMethod = new EntityMethod(method, returnsEntity);

    if(annotation.isDefault()) {
      defaultUpdateMethod = updateMethod;
    }
    updateMethods.put(name, updateMethod);
  }
View Full Code Here

Examples of org.openrdf.query.Update

        RepositoryConnection connection2 = repository.getConnection();
        try {
            String query = String.format("DELETE { <%s> <%s> ?v } INSERT { <%s> <%s> ?v . } WHERE { <%s> <%s> ?v }", subject.stringValue(), predicate.stringValue(), subject.stringValue(), predicate.stringValue(), subject.stringValue(), predicate.stringValue());

            Update u = connection2.prepareUpdate(QueryLanguage.SPARQL, query);
            u.execute();

            connection2.commit();
        } finally {
            connection2.close();
        }
View Full Code Here

Examples of org.skife.jdbi.v2.Update

        return q.first();
    }

    private Object handleDML(String s, Method method, Object[] args)
    {
        Update u = handle.createStatement(s);
        if (args != null) bindArguments(method.isAnnotationPresent(BindBy.class) ?
                                        method.getAnnotation(BindBy.class).value() :
                                        BindType.Position, u, args);
        Class rt = method.getReturnType();
        int changed = u.execute();
        if (method.getReturnType() == null)
        {
            return null;
        }
        else if (Integer.class.equals(rt) || int.class.equals(rt))
View Full Code Here

Examples of org.springframework.data.mongodb.core.query.Update

    mongoTemplate.insert(new Person("Dick", 22));
    mongoTemplate.insert(new Person("Harry", 23));

    Query queryObj = new Query(Criteria.where("name").is("Harry"));

    Update updateObj = new Update().inc("age", 1);

    // return's old person object
    p = mongoTemplate.findAndModify(queryObj, updateObj, Person.class);

    assertThat(p.getName(), is("Harry"));
View Full Code Here

Examples of org.tarantool.core.cmd.Update

  /** {@inheritDoc} */
  @Override
  public Tuple updateAndGet(int space, Tuple tuple, List<Operation> ops) {
    try {
      Response response = transport.execute(new Update(id.incrementAndGet(), tuple, ops).space(space).flags(Flags.RETURN_TUPLE));
      return response.readSingleTuple();
    } finally {
      returnConnection();
    }

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.