当前位置: 首页>>代码示例>>Java>>正文


Java SqlMapClient.update方法代码示例

本文整理汇总了Java中com.ibatis.sqlmap.client.SqlMapClient.update方法的典型用法代码示例。如果您正苦于以下问题:Java SqlMapClient.update方法的具体用法?Java SqlMapClient.update怎么用?Java SqlMapClient.update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.ibatis.sqlmap.client.SqlMapClient的用法示例。


在下文中一共展示了SqlMapClient.update方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doUpdate

import com.ibatis.sqlmap.client.SqlMapClient; //导入方法依赖的package包/类
private void doUpdate(Exchange exchange) throws Exception {
    SqlMapClient client = endpoint.getSqlMapClient();

    Object result;
    Object in = exchange.getIn().getBody();
    if (in != null) {
        // lets handle arrays or collections of objects
        Iterator<?> iter = ObjectHelper.createIterator(in);
        while (iter.hasNext()) {
            Object value = iter.next();
            LOG.trace("Updating: {} using statement: {}", value, statement);
            result = client.update(statement, value);
            doProcessResult(exchange, result);
        }
    } else {
        LOG.trace("Updating using statement: {}", statement);
        result = client.update(statement);
        doProcessResult(exchange, result);
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:21,代码来源:IBatisProducer.java

示例2: commit

import com.ibatis.sqlmap.client.SqlMapClient; //导入方法依赖的package包/类
public void commit(IBatisEndpoint endpoint, Exchange exchange, Object data, String consumeStatements) throws Exception {
    SqlMapClient client = endpoint.getSqlMapClient();
    boolean useTrans = endpoint.isUseTransactions();
    String[] statements = consumeStatements.split(",");
    try {
        if (useTrans) {
            client.startTransaction(isolation);
        }
        for (String statement : statements) {
            client.update(statement.trim(), data);
        }
        if (useTrans) {
            client.commitTransaction();
        }
    } finally {
        if (useTrans) {
            client.endTransaction();
        }
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:21,代码来源:DefaultIBatisProcessingStategy.java

示例3: update

import com.ibatis.sqlmap.client.SqlMapClient; //导入方法依赖的package包/类
@Override
public int update(Object shardingId, String sqlMapId, boolean afterInvoke) throws Exception {

	int result = -1;

	String[] array = getShardingArray(shardingId);
	if (null != array && 0 < array.length) {
		String dbName = array[0];
		SqlMapClient sqlMapClient = shardingStrategy.getSqlMapClientByDbName(dbName);
		if (null != sqlMapClient) {
			result = sqlMapClient.update(sqlMapId);
		}
	}

	if (afterInvoke) {
		afterInvoke(ShardingConfig.DB_OPTYPE_UPDATE, result, shardingId, null);
	}

	return result;
}
 
开发者ID:wangym,项目名称:koubei-sharding,代码行数:21,代码来源:BaseShardingDAO.java

示例4: updateShouldBeTraced

import com.ibatis.sqlmap.client.SqlMapClient; //导入方法依赖的package包/类
@Test
public void updateShouldBeTraced() throws Exception {
    // Given
    SqlMapClient sqlMapClient = new SqlMapClientImpl(this.mockSqlMapExecutorDelegate);
    // When
    sqlMapClient.update("updateId");
    sqlMapClient.update("updateId", new Object());
    // Then
    final List<SpanEventBo> spanEvents = getCurrentSpanEvents();
    assertThat(spanEvents.size(), is(2));

    // Check Method
    final SpanEventBo updateWith1ArgSpanEvent = spanEvents.get(0);
    final SpanEventBo updateWith2ArgSpanEvent = spanEvents.get(1);
    assertThat(updateWith1ArgSpanEvent.getApiId(), not(0));
    assertThat(updateWith2ArgSpanEvent.getApiId(), not(0));
    assertThat(updateWith1ArgSpanEvent.getApiId(), not(updateWith2ArgSpanEvent.getApiId()));

    // Check Parameter
    final List<AnnotationBo> updateWith1ArgAnnotations = updateWith1ArgSpanEvent.getAnnotationBoList();
    assertThat(updateWith1ArgAnnotations.size(), is(1));
    final AnnotationBo updateWith1ArgParameterAnnotation = updateWith1ArgAnnotations.get(0);
    assertThat(updateWith1ArgParameterAnnotation.getKey(), is(AnnotationKey.CACHE_ARGS0.getCode()));

    final List<AnnotationBo> updateWith2ArgAnnotations = updateWith2ArgSpanEvent.getAnnotationBoList();
    assertThat(updateWith2ArgAnnotations.size(), is(1));
    final AnnotationBo updateWith2ArgAnnotation = updateWith2ArgAnnotations.get(0);
    assertThat(updateWith2ArgAnnotation.getKey(), is(AnnotationKey.CACHE_ARGS0.getCode()));

}
 
开发者ID:masonmei,项目名称:apm-agent,代码行数:31,代码来源:SqlMapClientImplModifierTest.java

示例5: updateEntry

import com.ibatis.sqlmap.client.SqlMapClient; //导入方法依赖的package包/类
@Override
public Entry updateEntry(RequestContext request, Object entryId, Entry entry)
    throws FeedServerAdapterException {
  SqlMapClient client = getSqlMapClient();
  String queryId = config.getFeedId() + "-update-entry";
  try {
      Map<String, Object> params = getRequestParams(request);
      params.putAll(getPropertyMapForEntry(entry));
    return client.update(queryId, params) > 0 ? retrieveEntry(request,
        entryId) : null;
  } catch (SQLException e) {
    throw new FeedServerAdapterException(
        FeedServerAdapterException.Reason.ERROR_EXECUTING_ADAPTER_REQUEST, e.getMessage());
  }
}
 
开发者ID:jyang,项目名称:google-feedserver,代码行数:16,代码来源:IBatisCollectionAdapter.java


注:本文中的com.ibatis.sqlmap.client.SqlMapClient.update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。