Examples of Insert


Examples of org.geoserver.wfs.request.Insert

        TransactionRequest t = TransactionRequest.adapt(
            OwsUtils.parameter(operation.getParameters(), EObject.class));
        if (t != null) {
            for (TransactionElement el : t.getElements()) {
                if (el instanceof Insert) {
                    Insert in = (Insert) el;
                    //in the insert case the objects are gt feature types which are not mutable
                    // so we just check them and throw an exception if a name does not match
                    for (Iterator j = in.getFeatures().iterator(); j.hasNext(); ) {
                        Feature f = (Feature) j.next();
                        Name n = f.getType().getName();
                        if (n.getNamespaceURI() != null && !ns.getURI().equals(n.getNamespaceURI())) {
                            throw new WFSException(t, "No such feature type " + n);
                        }
View Full Code Here

Examples of org.geotools.data.wfs.internal.TransactionRequest.Insert

        final SimpleFeatureType remoteType = dataStore.getRemoteSimpleFeatureType(remoteTypeName);

        // Create a single insert element with all the inserts for this type
        final Map<String, SimpleFeature> added = diff.getAdded();
        if (added.size() > 0) {
            Insert insert = transactionRequest.createInsert(remoteTypeName);

            SimpleFeatureBuilder builder = new SimpleFeatureBuilder(remoteType);
            for (String fid : diff.getAddedOrder()) {
                if (ignored.contains(fid)) {
                    continue;
                }
                SimpleFeature localFeature = added.get(fid);
                MutableFeatureId addedFid = (MutableFeatureId) localFeature.getIdentifier();
                addedFeatureIds.add(addedFid);

                SimpleFeature remoteFeature = SimpleFeatureBuilder.retype(localFeature, builder);

                insert.add(remoteFeature);
            }
            transactionRequest.add(insert);
        }

        final Map<String, SimpleFeature> modified = diff.getModified();
View Full Code Here

Examples of org.h2.command.dml.Insert

            }
            if (asQuery != null) {
                boolean old = session.isUndoLogEnabled();
                try {
                    session.setUndoLogEnabled(false);
                    Insert insert = null;
                    insert = new Insert(session);
                    insert.setSortedInsertMode(sortedInsertMode);
                    insert.setQuery(asQuery);
                    insert.setTable(table);
                    insert.setInsertFromSelect(true);
                    insert.prepare();
                    insert.update();
                } finally {
                    session.setUndoLogEnabled(old);
                }
            }
        } catch (DbException e) {
View Full Code Here

Examples of org.h2.command.dml.Insert

        }
        return command;
    }

    private Insert parseInsert() {
        Insert command = new Insert(session);
        currentPrepared = command;
        read("INTO");
        Table table = readTableOrView();
        command.setTable(table);
        Column[] columns = null;
        if (readIf("(")) {
            if (isSelect()) {
                command.setQuery(parseSelect());
                read(")");
                return command;
            }
            columns = parseColumnList(table);
            command.setColumns(columns);
        }
        if (readIf("DIRECT")) {
            command.setInsertFromSelect(true);
        }
        if (readIf("SORTED")) {
            command.setSortedInsertMode(true);
        }
        if (readIf("DEFAULT")) {
            read("VALUES");
            Expression[] expr = { };
            command.addRow(expr);
        } else if (readIf("VALUES")) {
            read("(");
            do {
                ArrayList<Expression> values = New.arrayList();
                if (!readIf(")")) {
                    do {
                        if (readIf("DEFAULT")) {
                            values.add(null);
                        } else {
                            values.add(readExpression());
                        }
                    } while (readIfMore());
                }
                command.addRow(values.toArray(new Expression[values.size()]));
                // the following condition will allow (..),; and (..);
            } while (readIf(",") && readIf("("));
        } else if (readIf("SET")) {
            if (columns != null) {
                throw getSyntaxError();
            }
            ArrayList<Column> columnList = New.arrayList();
            ArrayList<Expression> values = New.arrayList();
            do {
                columnList.add(parseColumn(table));
                read("=");
                Expression expression;
                if (readIf("DEFAULT")) {
                    expression = ValueExpression.getDefault();
                } else {
                    expression = readExpression();
                }
                values.add(expression);
            } while (readIf(","));
            command.setColumns(columnList.toArray(new Column[columnList.size()]));
            command.addRow(values.toArray(new Expression[values.size()]));
        } else {
            command.setQuery(parseSelect());
        }
        return command;
    }
View Full Code Here

Examples of org.hibernate.sql.Insert

  /**
   * Generate the SQL INSERT that creates a new row
   */
  protected String generateInsertRowString() {
   
    Insert insert = new Insert( getDialect() )
        .setTableName( qualifiedTableName )
        .addColumns( keyColumnNames );
   
    if ( hasIdentifier) insert.addColumn( identifierColumnName );
   
    if ( hasIndex /*&& !indexIsFormula*/ ) {
      insert.addColumns( indexColumnNames, indexColumnIsSettable );
    }
   
    if ( getFactory().getSettings().isCommentsEnabled() ) {
      insert.setComment( "insert collection row " + getRole() );
    }
   
    //if ( !elementIsFormula ) {
      insert.addColumns( elementColumnNames, elementColumnIsSettable );
    //}
   
    return insert.toStatementString();
  }
View Full Code Here

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

    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);
      } else if (method.isAnnotationPresent(Delete.class)) {
        delete = method.getAnnotation(Delete.class);
        generateMethodSqlMapping(statementSb, "delete", method, delete
            .id(), null, delete.parameterClass(), null, Null.class,
            delete.sql(), null, null);
View Full Code Here

Examples of org.lealone.command.dml.Insert

    public Parser createParser() {
        return new Parser(this);
    }

    public Insert createInsert() {
        return new Insert(this);
    }
View Full Code Here

Examples of org.milyn.scribe.annotation.Insert

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

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

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

    assertUniqueName(insertMethods, Insert.class, name);

    if(annotation.isDefault() && defaultInsertMethod != null) {
      throw new IllegalAnnotationUsageException("At least two methods are annotated with the '"+ Insert.class.getName() +"'annotation having the isDefault on true. Only one method per class is allowed to be the default insert method.");
    }
    if(method.getParameterTypes().length == 0) {
      throw new IllegalAnnotationUsageException("The Insert annotated method '"+ method +"' of the DAO class '"+ daoClass.getName() +"'  doesn't have any parameters.");
    }
    if(method.getParameterTypes().length > 1) {
      throw new IllegalAnnotationUsageException("The Insert 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 insertMethod = new EntityMethod(method, returnsEntity);

    if(annotation.isDefault()) {
      defaultInsertMethod = insertMethod;
    }
    insertMethods.put(name, insertMethod);
  }
View Full Code Here

Examples of org.rascalmpl.interpreter.control_exceptions.Insert

            throw new InterruptException(eval.getStackTrace(), eval.getCurrentAST().getLocation());
          if (mp.next()) {
            int size = conditions.size();
           
            if (size == 0) {
               throw new Insert(replacementExpr.interpret(eval), mp, mp.getType(eval.getCurrentEnvt(), null));
            }
           
            IBooleanResult[] gens = new IBooleanResult[size];
            Environment[] olds = new Environment[size];
            Environment old2 = eval.getCurrentEnvt();

            int i = 0;
            try {
              olds[0] = eval.getCurrentEnvt();
              eval.pushEnv();
              gens[0] = conditions.get(0).getBacktracker(eval);
              gens[0].init();

              while (i >= 0 && i < size) {

                if (eval.isInterrupted()) {
                  throw new InterruptException(eval.getStackTrace(), eval.getCurrentAST().getLocation());
                }
                if (gens[i].hasNext() && gens[i].next()) {
                  if (i == size - 1) {
                    // in IfThen the body is executed, here we insert the expression
                    // NB: replaceMentExpr sees the latest bindings of the when clause
                    throw new Insert(replacementExpr.interpret(eval), mp, mp.getType(eval.getCurrentEnvt(), null));
                  }

                  i++;
                  gens[i] = conditions.get(i).getBacktracker(eval);
                  gens[i].init();
View Full Code Here

Examples of org.switchyard.component.rules.annotation.Insert

                inputMappingAnnotations = executeAnnotation.inputs();
                outputMappingAnnotations = executeAnnotation.outputs();
                faultMappingAnnotations = executeAnnotation.faults();
            } else if (INSERT_FILTER.matches(method)) {
                operationType = RulesOperationType.INSERT;
                Insert insertAnnotation = method.getAnnotation(Insert.class);
                globalMappingAnnotations = insertAnnotation.globals();
                inputMappingAnnotations = insertAnnotation.inputs();
                outputMappingAnnotations = insertAnnotation.outputs();
                faultMappingAnnotations = insertAnnotation.faults();
            } else if (FIRE_ALL_RULES_FILTER.matches(method)) {
                operationType = RulesOperationType.FIRE_ALL_RULES;
                FireAllRules fireAllRulesAnnotation = method.getAnnotation(FireAllRules.class);
                globalMappingAnnotations = fireAllRulesAnnotation.globals();
                inputMappingAnnotations = fireAllRulesAnnotation.inputs();
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.