Package org.apache.ws.jaxme.js

Examples of org.apache.ws.jaxme.js.JavaMethod.newJavaField()


    InsertStatement insertStatement = table.getInsertStatement();
    String s = table.getSchema().getSQLFactory().newSQLGenerator().getQuery(insertStatement);
    Object query = JavaSource.getQuoted(s);
    if (isGeneratingLogging()) {
      LocalJavaField q = jm.newJavaField(String.class);
      q.addLine(query);
      query = q;
      logFinest(jm, query, values);
    }
    LocalJavaField stmt = jm.newJavaField(PreparedStatement.class, "stmt");
View Full Code Here


      LocalJavaField q = jm.newJavaField(String.class);
      q.addLine(query);
      query = q;
      logFinest(jm, query, values);
    }
    LocalJavaField stmt = jm.newJavaField(PreparedStatement.class, "stmt");
    stmt.setFinal(true);
    stmt.addLine(connection, ".prepareStatement(", JavaSource.getQuoted(s), ");");
    LocalJavaField isStmtClosed = jm.newJavaField(boolean.class, "isStmtClosed");
    isStmtClosed.addLine("false");
    jm.addTry();
View Full Code Here

      logFinest(jm, query, values);
    }
    LocalJavaField stmt = jm.newJavaField(PreparedStatement.class, "stmt");
    stmt.setFinal(true);
    stmt.addLine(connection, ".prepareStatement(", JavaSource.getQuoted(s), ");");
    LocalJavaField isStmtClosed = jm.newJavaField(boolean.class, "isStmtClosed");
    isStmtClosed.addLine("false");
    jm.addTry();

    int paramNum = 0;
    for (Iterator iter = table.getColumns();  iter.hasNext()) {
View Full Code Here

    DirectAccessible conn = jm.addParam(Connection.class, "pConn");
    DirectAccessible row = jm.addParam(resultType, "pRow");

    logEntering(jm, new Object[]{"new ", Object[].class, "{", conn, ", ", row, "}"});

    LocalJavaField map = jm.newJavaField(Map.class, "clonedObjects");
    map.addLine("new ", HashMap.class, "()");

    getSelectRowsCode(jm, headTable, headTable.getTable().getPrimaryKey(),
                      conn, map, row, true);
    return jm;
View Full Code Here

        js = factory.newJavaSource(JavaQNameImpl.getInstance(PACKAGE_NAME, CLASS_NAME));
        js.newJavaInnerClass("Bof");
        jf = js.newJavaField("someField", int.class);
        jcon = js.newJavaConstructor();
        jm = js.newJavaMethod("test", void.class);
        lfj = jm.newJavaField(String.class, "localTest");
      } else {
        js = factory.newJavaSource(JavaQNameImpl.getInstance(PACKAGE_NAME, CLASS_NAME), pProtection);
        js.newJavaInnerClass("Bof", pProtection);
        jf = js.newJavaField("someField", int.class, pProtection);
        jcon = js.newJavaConstructor(pProtection);
View Full Code Here

        js = factory.newJavaSource(JavaQNameImpl.getInstance(PACKAGE_NAME, CLASS_NAME), pProtection);
        js.newJavaInnerClass("Bof", pProtection);
        jf = js.newJavaField("someField", int.class, pProtection);
        jcon = js.newJavaConstructor(pProtection);
        jm = js.newJavaMethod("test", void.class, pProtection);
        lfj = jm.newJavaField(String.class, "localTest");
      }
      lfj.setFinal(true);
      lfj.addLine(JavaSource.getQuoted("abc"));

      jcon.addLine(jf, " = 0;");
View Full Code Here

    Parameter pElement = jm.addParam(Element.class, "pElement");
    jm.addThrows(PMException.class);
    Table table = pData.getTable();

    String q = table.getSchema().getSQLFactory().newSQLGenerator().getQuery(table.getInsertStatement());
    LocalJavaField query = jm.newJavaField(String.class);
    query.setFinal(true);
    query.addLine(JavaSource.getQuoted(q));

    JavaQName qName = pController.getComplexTypeSG().getClassContext().getXMLInterfaceName();
    LocalJavaField elem = jm.newJavaField(qName);
View Full Code Here

    LocalJavaField query = jm.newJavaField(String.class);
    query.setFinal(true);
    query.addLine(JavaSource.getQuoted(q));

    JavaQName qName = pController.getComplexTypeSG().getClassContext().getXMLInterfaceName();
    LocalJavaField elem = jm.newJavaField(qName);
    elem.addLine("(", qName, ") ", pElement);

    LocalJavaField connection = jm.newJavaField(Connection.class);
    connection.addLine("null");
    jm.addTry();
View Full Code Here

    JavaQName qName = pController.getComplexTypeSG().getClassContext().getXMLInterfaceName();
    LocalJavaField elem = jm.newJavaField(qName);
    elem.addLine("(", qName, ") ", pElement);

    LocalJavaField connection = jm.newJavaField(Connection.class);
    connection.addLine("null");
    jm.addTry();
    jm.addLine(connection, " = getConnection();");
    LocalJavaField stmt = jm.newJavaField(PreparedStatement.class);
    stmt.addLine(connection, ".prepareStatement(", query, ")");
View Full Code Here

    LocalJavaField connection = jm.newJavaField(Connection.class);
    connection.addLine("null");
    jm.addTry();
    jm.addLine(connection, " = getConnection();");
    LocalJavaField stmt = jm.newJavaField(PreparedStatement.class);
    stmt.addLine(connection, ".prepareStatement(", query, ")");
    jm.addTry();
    getPreparedStatementParameters(jm, stmt, elem, table.getColumns(), 0);
    jm.addLine(stmt, ".executeUpdate();");
    getFinally(jm, stmt, null, null);
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.