• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SqlMapClientImpl类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.ibatis.sqlmap.engine.impl.SqlMapClientImpl的典型用法代码示例。如果您正苦于以下问题:Java SqlMapClientImpl类的具体用法?Java SqlMapClientImpl怎么用?Java SqlMapClientImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SqlMapClientImpl类属于com.ibatis.sqlmap.engine.impl包,在下文中一共展示了SqlMapClientImpl类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: exceptionsThrownShouldBeTraced

import com.ibatis.sqlmap.engine.impl.SqlMapClientImpl; //导入依赖的package包/类
@Test
public void exceptionsThrownShouldBeTraced() throws Exception {
    // Given
    when(this.mockSqlMapExecutorDelegate.beginSessionScope()).thenReturn(null);
    SqlMapClient sqlMapClient = new SqlMapClientImpl(this.mockSqlMapExecutorDelegate);
    // When
    try {
        sqlMapClient.insert("insertShouldThrowNPE");
        fail("sqlMapClient.insert should throw NullPointerException");
    } catch (NullPointerException e) {
        // Then
        final List<SpanEventBo> spanEvents = getCurrentSpanEvents();
        assertThat(spanEvents.size(), is(1));
        final SpanEventBo exceptionSpanEventBo = spanEvents.get(0);
        assertThat(exceptionSpanEventBo.hasException(), is(true));
        assertThat(exceptionSpanEventBo.getExceptionId(), not(0));
    }
}
 
开发者ID:masonmei,项目名称:apm-agent,代码行数:19,代码来源:SqlMapClientImplModifierTest.java


示例2: nullParametersShouldNotBeTraced

import com.ibatis.sqlmap.engine.impl.SqlMapClientImpl; //导入依赖的package包/类
@Test
public void nullParametersShouldNotBeTraced() throws Exception {
    // Given
    SqlMapClient sqlMapClient = new SqlMapClientImpl(this.mockSqlMapExecutorDelegate);
    // When
    sqlMapClient.insert(null);
    sqlMapClient.queryForList(null);
    // Then
    final List<SpanEventBo> spanEvents = getCurrentSpanEvents();
    assertThat(spanEvents.size(), is(2));

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

    // Check Parameter
    assertNull(insertSpanEventBo.getAnnotationBoList());
    assertNull(queryForListSpanEventBo.getAnnotationBoList());
}
 
开发者ID:masonmei,项目名称:apm-agent,代码行数:23,代码来源:SqlMapClientImplModifierTest.java


示例3: sameApiCallsShouldHaveTheSameApiId

import com.ibatis.sqlmap.engine.impl.SqlMapClientImpl; //导入依赖的package包/类
@Test
public void sameApiCallsShouldHaveTheSameApiId() throws Exception {
    // Given
    SqlMapClient sqlMapClient = new SqlMapClientImpl(this.mockSqlMapExecutorDelegate);
    // When
    sqlMapClient.insert("insertA");
    sqlMapClient.insert("insertB");
    // Then
    final List<SpanEventBo> spanEvents = getCurrentSpanEvents();
    assertThat(spanEvents.size(), is(2));

    // Check Method
    final SpanEventBo insertASpanEventBo = spanEvents.get(0);
    final SpanEventBo insertBSpanEventBo = spanEvents.get(1);
    assertThat(insertASpanEventBo.getApiId(), not(0));
    assertThat(insertBSpanEventBo.getApiId(), not(0));
    assertThat(insertASpanEventBo.getApiId(), is(insertBSpanEventBo.getApiId()));

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


示例4: queryForListShouldBeTraced

import com.ibatis.sqlmap.engine.impl.SqlMapClientImpl; //导入依赖的package包/类
@Test
public void queryForListShouldBeTraced() throws Exception {
    // Given
    SqlMapClient sqlMapClient = new SqlMapClientImpl(this.mockSqlMapExecutorDelegate);
    // When
    sqlMapClient.queryForList("abc");
    // Then
    final List<SpanEventBo> spanEvents = getCurrentSpanEvents();
    assertThat(spanEvents.size(), is(1));

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

    // Check Parameter
    final List<AnnotationBo> annotationBoList = apiCallSpanEventBo.getAnnotationBoList();
    assertThat(annotationBoList.size(), is(1));

    final AnnotationBo parameterAnnotationBo = annotationBoList.get(0);
    assertThat(parameterAnnotationBo.getKey(), is(AnnotationKey.CACHE_ARGS0.getCode()));
}
 
开发者ID:masonmei,项目名称:apm-agent,代码行数:22,代码来源:SqlMapClientImplModifierTest.java


示例5: queryForObjectShouldBeTraced

import com.ibatis.sqlmap.engine.impl.SqlMapClientImpl; //导入依赖的package包/类
@Test
public void queryForObjectShouldBeTraced() throws Exception {
    // Given
    SqlMapClient sqlMapClient = new SqlMapClientImpl(this.mockSqlMapExecutorDelegate);
    // When
    sqlMapClient.queryForObject("abrgrgfdaghertah", new Object());
    // Then
    final List<SpanEventBo> spanEvents = getCurrentSpanEvents();
    assertThat(spanEvents.size(), is(1));

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

    // Check Parameter
    final List<AnnotationBo> annotationBoList = apiCallSpanEventBo.getAnnotationBoList();
    assertThat(annotationBoList.size(), is(1));

    final AnnotationBo parameterAnnotationBo = annotationBoList.get(0);
    assertThat(parameterAnnotationBo.getKey(), is(AnnotationKey.CACHE_ARGS0.getCode()));
}
 
开发者ID:masonmei,项目名称:apm-agent,代码行数:22,代码来源:SqlMapClientImplModifierTest.java


示例6: getResult

import com.ibatis.sqlmap.engine.impl.SqlMapClientImpl; //导入依赖的package包/类
protected static Object getResult(SqlMapClientImpl client, String statementName, Object parameterObject,
    Class targetType) throws SQLException {
  Object value = null;
  if (DomCollectionTypeMarker.class.isAssignableFrom(targetType)) {
    value = client.queryForList(statementName, parameterObject);
  } else if (Set.class.isAssignableFrom(targetType)) {
    value = new HashSet(client.queryForList(statementName, parameterObject));
  } else if (Collection.class.isAssignableFrom(targetType)) {
    value = client.queryForList(statementName, parameterObject);
  } else if (targetType.isArray()) {
    List list = client.queryForList(statementName, parameterObject);
    value = listToArray(list, targetType.getComponentType());
  } else {
    value = client.queryForObject(statementName, parameterObject);
  }
  return value;
}
 
开发者ID:mybatis,项目名称:ibatis-2,代码行数:18,代码来源:ResultLoader.java


示例7: retrieveOutputParameters

import com.ibatis.sqlmap.engine.impl.SqlMapClientImpl; //导入依赖的package包/类
private void retrieveOutputParameters(StatementScope statementScope, CallableStatement cs,
    ParameterMapping[] mappings, Object[] parameters, RowHandlerCallback callback) throws SQLException {
  for (int i = 0; i < mappings.length; i++) {
    ParameterMapping mapping = ((ParameterMapping) mappings[i]);
    if (mapping.isOutputAllowed()) {
      if ("java.sql.ResultSet".equalsIgnoreCase(mapping.getJavaTypeName())) {
        ResultSet rs = (ResultSet) cs.getObject(i + 1);
        ResultMap resultMap;
        if (mapping.getResultMapName() == null) {
          resultMap = statementScope.getResultMap();
          handleOutputParameterResults(statementScope, resultMap, rs, callback);
        } else {
          SqlMapClientImpl client = (SqlMapClientImpl) statementScope.getSession().getSqlMapClient();
          resultMap = client.getDelegate().getResultMap(mapping.getResultMapName());
          DefaultRowHandler rowHandler = new DefaultRowHandler();
          RowHandlerCallback handlerCallback = new RowHandlerCallback(resultMap, null, rowHandler);
          handleOutputParameterResults(statementScope, resultMap, rs, handlerCallback);
          parameters[i] = rowHandler.getList();
        }
        rs.close();
      } else {
        parameters[i] = mapping.getTypeHandler().getResult(cs, i + 1);
      }
    }
  }
}
 
开发者ID:mybatis,项目名称:ibatis-2,代码行数:27,代码来源:DefaultSqlExecutor.java


示例8: setupMockSqlMapClientImpl

import com.ibatis.sqlmap.engine.impl.SqlMapClientImpl; //导入依赖的package包/类
/**
 * Mock a {@link SqlMapClientImpl} which returns a {@link Bean1} for the id <code>bean1</code> and {@link Bean2} for
 * id <code>bean2</code>.
 */
private SqlMapClientImpl setupMockSqlMapClientImpl() {
  SqlMapExecutorDelegate delegate = new SqlMapExecutorDelegate();
  SqlMapClientImpl client = new SqlMapClientImpl(delegate) {
    @Override
    public Object queryForObject(String id, Object paramObject) throws SQLException {
      if ("bean1".equals(id)) {
        return new Bean1();
      } else if ("bean2".equals(id)) {
        Bean2 bean = new Bean2();
        EnhancedLazyResultLoader loader = new EnhancedLazyResultLoader(this, "bean1", null, Bean1.class);
        bean.setBean1((Bean1) loader.loadResult());
        return bean;
      } else if ("bean3".equals(id)) {
        return null;
      }
      fail();
      return null;
    }
  };
  return client;
}
 
开发者ID:mybatis,项目名称:ibatis-2,代码行数:26,代码来源:EnhancedLazyResultLoaderTest.java


示例9: getSQL

import com.ibatis.sqlmap.engine.impl.SqlMapClientImpl; //导入依赖的package包/类
public String getSQL(String id,Object params){
	
	try {
		SqlMapClientImpl sci = (SqlMapClientImpl)this.sqlMapClientTemplate.getSqlMapClient();  
    	MappedStatement ms = sci.getMappedStatement(id);  
    	          
    	Sql sql = ms.getSql();    
    	        
    	SessionScope sessionScope = new SessionScope();       
    	sessionScope.incrementRequestStackDepth();       
    	StatementScope statementScope = new StatementScope(sessionScope);       
    	ms.initRequest(statementScope);      
    	ms.getCacheKey(statementScope, params);  
    	
    	String sqlString = sql.getSql(statementScope, params);
    	Object[] sqlParam = sql.getParameterMap(statementScope, params).getParameterObjectValues(statementScope, params);  
    	
    	int sqlParamLen = sqlParam.length;
    	if (sqlParam != null && sqlParamLen > 0) {
    		for (int i=0; i < sqlParamLen; i++) {
    			if (sqlParam[i] instanceof Integer) {
    				sqlString = sqlString.replaceFirst("\\?", sqlParam[i].toString());
    			}
    			else if (sqlParam[i] instanceof String) {
    				sqlString = sqlString.replaceFirst("\\?", "'" + sqlParam[i].toString() + "'");
    			}
    		}
    	}
    	return sqlString;
	} catch (Exception ex) {
		LogConstant.error(ex.getMessage(), ex);
		LogConstant.error("获取SQL 出错, id: " + id);
	}
	
	return "[未能获取 SQL语句](id: " + id + ")";

}
 
开发者ID:shuqin,项目名称:ALLIN,代码行数:38,代码来源:SqlMapClientTemplateSupport.java


示例10: test

import com.ibatis.sqlmap.engine.impl.SqlMapClientImpl; //导入依赖的package包/类
@Test(expected=NullPointerException.class)
public void test() throws SQLException {
    // Given
    when(this.mockSqlMapExecutorDelegate.beginSessionScope()).thenReturn(null);
    SqlMapClient sqlMapClient = new SqlMapClientImpl(this.mockSqlMapExecutorDelegate);
    // When
    sqlMapClient.insert("insertShouldThrowNPE");
}
 
开发者ID:masonmei,项目名称:apm-agent,代码行数:9,代码来源:SqlMapClientImplModifierTest.java


示例11: insertShouldBeTraced

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

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

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

    final List<AnnotationBo> insertWith2ArgAnnotations = insertWith2ArgSpanEventBo.getAnnotationBoList();
    assertThat(insertWith2ArgAnnotations.size(), is(1));
    final AnnotationBo insertWith2ArgAnnotation = insertWith2ArgAnnotations.get(0);
    assertThat(insertWith2ArgAnnotation.getKey(), is(AnnotationKey.CACHE_ARGS0.getCode()));

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


示例12: deleteShouldBeTraced

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

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

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

    final List<AnnotationBo> deleteWith2ArgAnnotations = deleteWith2ArgSpanEvent.getAnnotationBoList();
    assertThat(deleteWith2ArgAnnotations.size(), is(1));
    final AnnotationBo deleteWith2ArgAnnotation = deleteWith2ArgAnnotations.get(0);
    assertThat(deleteWith2ArgAnnotation.getKey(), is(AnnotationKey.CACHE_ARGS0.getCode()));
}
 
开发者ID:masonmei,项目名称:apm-agent,代码行数:30,代码来源:SqlMapClientImplModifierTest.java


示例13: updateShouldBeTraced

import com.ibatis.sqlmap.engine.impl.SqlMapClientImpl; //导入依赖的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


示例14: transactionsShouldBeTraced

import com.ibatis.sqlmap.engine.impl.SqlMapClientImpl; //导入依赖的package包/类
@Ignore // Changed to trace only query operations
@Test
public void transactionsShouldBeTraced() throws Exception {
    // Given
    SqlMapClient sqlMapClient = new SqlMapClientImpl(this.mockSqlMapExecutorDelegate);
    // When
    sqlMapClient.startTransaction();
    sqlMapClient.commitTransaction();
    sqlMapClient.endTransaction();
    // Then
    final List<SpanEventBo> spanEvents = getCurrentSpanEvents();
    assertThat(spanEvents.size(), is(3));

    // Check Method
    final SpanEventBo startTransactionSpanEventBo = spanEvents.get(0);
    final SpanEventBo commitTransactionSpanEventBo = spanEvents.get(1);
    final SpanEventBo endTransactionSpanEventBo = spanEvents.get(2);

    assertThat(startTransactionSpanEventBo.getApiId(), not(0));
    assertThat(commitTransactionSpanEventBo.getApiId(), not(0));
    assertThat(endTransactionSpanEventBo.getApiId(), not(0));

    assertThat(startTransactionSpanEventBo.getApiId(), not(commitTransactionSpanEventBo.getApiId()));
    assertThat(commitTransactionSpanEventBo.getApiId(), not(endTransactionSpanEventBo.getApiId()));
    assertThat(endTransactionSpanEventBo.getApiId(), not(startTransactionSpanEventBo.getApiId()));

    // Check Parameter
    assertNull(startTransactionSpanEventBo.getAnnotationBoList());
    assertNull(commitTransactionSpanEventBo.getAnnotationBoList());
    assertNull(endTransactionSpanEventBo.getAnnotationBoList());
}
 
开发者ID:masonmei,项目名称:apm-agent,代码行数:32,代码来源:SqlMapClientImplModifierTest.java


示例15: translateStatementName

import com.ibatis.sqlmap.engine.impl.SqlMapClientImpl; //导入依赖的package包/类
private String translateStatementName(String statementName) {
    if (systemEnvironment.isDefaultDbProvider()) {
        return statementName;
    }
    String forExternalDb = String.format("%s-%s", statementName, database.getType());
    MappedStatement statement;
    try {
        statement = ((SqlMapClientImpl) super.getSqlMapClient()).getMappedStatement(forExternalDb);
    } catch (Exception e) {
        statement = null;
    }
    return statement != null ? forExternalDb : statementName;
}
 
开发者ID:gocd,项目名称:gocd,代码行数:14,代码来源:SqlMapClientDaoSupport.java


示例16: getSqlByStatementName

import com.ibatis.sqlmap.engine.impl.SqlMapClientImpl; //导入依赖的package包/类
protected String getSqlByStatementName(String statementName, Object parameterObject) {
    SqlMapClientImpl sqlMapClientImpl = (SqlMapClientImpl) getSqlMapClient();
    Sql sql = sqlMapClientImpl.getMappedStatement(statementName).getSql();
    if (sql instanceof StaticSql) {
        return sql.getSql(null, parameterObject);
    } else {
        logger.info("dynamic sql can only return sql id.");
        return statementName;
    }
}
 
开发者ID:alibaba,项目名称:cobarclient,代码行数:11,代码来源:CobarSqlMapClientTemplate.java


示例17: prepareStatement

import com.ibatis.sqlmap.engine.impl.SqlMapClientImpl; //导入依赖的package包/类
private PreparedStatement prepareStatement(SessionScope sessionScope, Connection conn, String sql, Integer rsType)
    throws SQLException {
  SqlMapExecutorDelegate delegate = ((SqlMapClientImpl) sessionScope.getSqlMapExecutor()).getDelegate();
  if (sessionScope.hasPreparedStatementFor(sql)) {
    return sessionScope.getPreparedStatement((sql));
  } else {
    PreparedStatement ps = conn.prepareStatement(sql, rsType.intValue(), ResultSet.CONCUR_READ_ONLY);
    sessionScope.putPreparedStatement(delegate, sql, ps);
    return ps;
  }
}
 
开发者ID:mybatis,项目名称:ibatis-2,代码行数:12,代码来源:DefaultSqlExecutor.java


示例18: prepareCall

import com.ibatis.sqlmap.engine.impl.SqlMapClientImpl; //导入依赖的package包/类
private CallableStatement prepareCall(SessionScope sessionScope, Connection conn, String sql, Integer rsType)
    throws SQLException {
  SqlMapExecutorDelegate delegate = ((SqlMapClientImpl) sessionScope.getSqlMapExecutor()).getDelegate();
  if (sessionScope.hasPreparedStatementFor(sql)) {
    return (CallableStatement) sessionScope.getPreparedStatement((sql));
  } else {
    CallableStatement cs = conn.prepareCall(sql, rsType.intValue(), ResultSet.CONCUR_READ_ONLY);
    sessionScope.putPreparedStatement(delegate, sql, cs);
    return cs;
  }
}
 
开发者ID:mybatis,项目名称:ibatis-2,代码行数:12,代码来源:DefaultSqlExecutor.java


示例19: testProxyMethodAccess

import com.ibatis.sqlmap.engine.impl.SqlMapClientImpl; //导入依赖的package包/类
/**
 * Test if a method in a proxied object can access a default method of another class in the same package with default
 * access modifier.
 * <p>
 * Depending of the implementation of the Cglib-proxy the access will throw an IllegalAccessException.
 */
public void testProxyMethodAccess() throws SQLException {
  SqlMapClientImpl client = setupMockSqlMapClientImpl();

  EnhancedLazyResultLoader loader = new EnhancedLazyResultLoader(client, "bean2", null, Bean2.class);
  Bean2 bean2 = (Bean2) loader.loadResult();

  // cglib might throw an IllegalAccessException
  bean2.testDefaultAccess();
}
 
开发者ID:mybatis,项目名称:ibatis-2,代码行数:16,代码来源:EnhancedLazyResultLoaderTest.java


示例20: testNullProxy

import com.ibatis.sqlmap.engine.impl.SqlMapClientImpl; //导入依赖的package包/类
/**
 * Test if a proxy for a null nevertheless dispatch to a default object.
 */
public void testNullProxy() throws SQLException {
  SqlMapClientImpl client = setupMockSqlMapClientImpl();

  EnhancedLazyResultLoader loader = new EnhancedLazyResultLoader(client, "bean3", null, TestBean3.class);
  TestBean3 bean = (TestBean3) loader.loadResult();

  assertEquals("foobar", bean.getText());
}
 
开发者ID:mybatis,项目名称:ibatis-2,代码行数:12,代码来源:EnhancedLazyResultLoaderTest.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BlockIterator类代码示例发布时间:2022-05-23
下一篇:
Java FrameSlotTypeException类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap