Package org.apache.ws.jaxme.sqls

Examples of org.apache.ws.jaxme.sqls.InsertStatement


   public int hashCode() {
      return getSchema().hashCode() + getName().hashCode();
   }

   public InsertStatement getInsertStatement() {
      InsertStatement result = getSchema().getSQLFactory().newInsertStatement();
      result.setTable(this);
      for (Iterator iter = getColumns();  iter.hasNext()) {
         result.addSet((Column) iter.next());
      }
      return result;
   }
View Full Code Here


  /** <p>Basic test for creating an <code>INSERT</code> statement.</p>
   */
  public void testBasicInsert() {
    Table table = getBasicTable();
    InsertStatement insertStatement = table.getInsertStatement();
    SQLGenerator generator = sqlFactory.newSQLGenerator();
    generator.setLineTerminator("\n");
    String s = generator.getQuery(insertStatement);
    assertEquals("INSERT INTO MySchema.MyTable (MyIndex, MyName, MyDate) VALUES (?, ?, ?)", s);
  }
View Full Code Here

    DirectAccessible connection = jm.addParam(Connection.class, "pConn");
    DirectAccessible values = jm.addParam(Object[].class, "pValue");

    logFinestEntering(jm, null);

    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);
View Full Code Here

   
    /** <p>Basic test for creating an <code>INSERT</code> statement.</p>
     */
    public void testBasicInsert() {
        Table table = getBasicTable();
        InsertStatement insertStatement = table.getInsertStatement();
        SQLGenerator generator = getSQLGenerator();
        generator.setLineTerminator("\n");
        String s = generator.getQuery(insertStatement);
        assertEquals("INSERT INTO MySchema.MyTable (MyIndex, MyName, MyDate) VALUES (?, ?, ?)", s);
    }
View Full Code Here

   public int hashCode() {
      return getSchema().hashCode() + getName().hashCode();
   }

   public InsertStatement getInsertStatement() {
      InsertStatement result = getSchema().getSQLFactory().newInsertStatement();
      result.setTable(this);
      for (Iterator iter = getColumns();  iter.hasNext()) {
         result.addSet((Column) iter.next());
      }
      return result;
   }
View Full Code Here

   
    /** <p>Basic test for creating an <code>INSERT</code> statement.</p>
     */
    public void testBasicInsert() {
        Table table = getBasicTable();
        InsertStatement insertStatement = table.getInsertStatement();
        SQLGenerator generator = getSQLGenerator();
        generator.setLineTerminator("\n");
        String s = generator.getQuery(insertStatement);
        assertEquals("INSERT INTO MySchema.MyTable (MyIndex, MyName, MyDate) VALUES (?, ?, ?)", s);
    }
View Full Code Here

        return "INSERT INTO MySchema.MyTable (MyTable.MyIndex, MyTable.MyName, MyTable.MyDate) (SELECT MyTable0.MyIndex, MyTable0.MyName, MyTable0.MyDate FROM MySchema.MyTable AS MyTable0)";
    }

    public void testBulkInsert() {
        Table table = getBasicTable();
        InsertStatement insertStatement = getSQLFactory().newInsertStatement();
        insertStatement.setTable(table);
        SelectStatement st = table.getSelectStatement();
        SQLGenerator generator = getSQLGenerator();
        generator.setLineTerminator("\n");
        insertStatement.setSubSelect(st);
        String got = generator.getQuery(insertStatement);
        String expect = getBulkInsertResult();
        assertEquals(expect, got);
    }
View Full Code Here

    DirectAccessible connection = jm.addParam(Connection.class, "pConn");
    DirectAccessible values = jm.addParam(Object[].class, "pValue");
   
    logFinestEntering(jm, null);
   
    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);
View Full Code Here

   public int hashCode() {
      return getSchema().hashCode() + getName().hashCode();
   }

   public InsertStatement getInsertStatement() {
      InsertStatement result = getSchema().getSQLFactory().newInsertStatement();
      result.setTable(this);
      for (Iterator iter = getColumns();  iter.hasNext()) {
         result.addSet((Column) iter.next());
      }
      return result;
   }
View Full Code Here

    DirectAccessible connection = jm.addParam(Connection.class, "pConn");
    DirectAccessible values = jm.addParam(Object[].class, "pValue");
   
    logFinestEntering(jm, null);
   
    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);
View Full Code Here

TOP

Related Classes of org.apache.ws.jaxme.sqls.InsertStatement

Copyright © 2018 www.massapicom. 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.