Package br.com.objectos.way.relational

Examples of br.com.objectos.way.relational.Insert$ToUpdate


        .list();

    assertThat(inserts.size(), equalTo(2));

    Insert i0 = inserts.get(0);
    assertThat(i0.toString(), equalTo("INSERT INTO A (`A0`, `A1`) VALUES (?, ?)"));

    Insert i1 = inserts.get(1);
    assertThat(i1.toString(), equalTo("INSERT INTO B (`B0`, `B1`) VALUES (?, ?)"));
  }
View Full Code Here


    return value;
  }

  @Override
  public Insert getInsert() {
    Insert insert = Insert //
        .into(getTable()) //
        .onGeneratedKey(new GeneratedKeyCallback() {
          @Override
          public void set(ResultSet rs) throws SQLException {
            id = rs.next() ? rs.getInt(1) : null;
View Full Code Here

*/
@Test
public class InsertTest {

  public void insert_should_be_converted_to_update() {
    Insert insert = Insert.into("MY_TABLE")
        .value("COL1", "A")
        .value("COL2", "B");

    String sql = insert.toUpdate(new PrimaryKey(123));

    assertThat(sql, equalTo("update MY_TABLE set `COL1`=?, `COL2`=? where `ID`=?"));
  }
View Full Code Here

TOP

Related Classes of br.com.objectos.way.relational.Insert$ToUpdate

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.