Package com.ibatis.sqlmap.client

Examples of com.ibatis.sqlmap.client.SqlMapSession.update()


      // Execute given callback...
      try {
        session.startBatch();
        for (T item : items) {
          session.update(statementId, item);
        }
        try {
          return session.executeBatchDetailed();
        } catch (BatchException e) {
          throw e.getBatchUpdateException();
View Full Code Here


    when(smc.openSession()).thenReturn(sms);
    sms.close();
    when(sms.getCurrentConnection()).thenReturn(null);
    sms.setUserConnection(null);
    sms.startBatch();
    when(sms.update("updateFoo", new Foo("bar"))).thenReturn(-2);
    List<BatchResult> results = Collections.singletonList(new BatchResult("updateFoo", "update foo"));
    results.get(0).setUpdateCounts(new int[] {1});
    when(sms.executeBatchDetailed()).thenReturn(results);
    writer.write(Collections.singletonList(new Foo("bar")));
  }
View Full Code Here

    when(smc.openSession()).thenReturn(sms);
    sms.close();
    when(sms.getCurrentConnection()).thenReturn(null);
    sms.setUserConnection(null);
    sms.startBatch();
    when(sms.update("updateFoo", new Foo("bar"))).thenReturn(1);
    List<BatchResult> results = Collections.singletonList(new BatchResult("updateFoo", "update foo"));
    results.get(0).setUpdateCounts(new int[] {0});
    when(sms.executeBatchDetailed()).thenReturn(results);
    try {
      writer.write(Collections.singletonList(new Foo("bar")));
View Full Code Here

    when(smc.openSession()).thenReturn(sms);
    sms.close();
    when(sms.getCurrentConnection()).thenReturn(null);
    sms.setUserConnection(null);
    sms.startBatch();
    when(sms.update("updateFoo", new Foo("bar"))).thenThrow(ex);
    try {
      writer.write(Collections.singletonList(new Foo("bar")));
      fail("Expected RuntimeException");
    }
    catch (RuntimeException e) {
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.