org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator.populateKeys()方法的使用及代码示例

x33g5p2x  于2022-01-22 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(60)

本文整理了Java中org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator.populateKeys()方法的一些代码示例,展示了Jdbc3KeyGenerator.populateKeys()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jdbc3KeyGenerator.populateKeys()方法的具体详情如下:
包路径:org.apache.ibatis.executor.keygen.Jdbc3KeyGenerator
类名称:Jdbc3KeyGenerator
方法名:populateKeys

Jdbc3KeyGenerator.populateKeys介绍

暂无

代码示例

代码示例来源:origin: org.mybatis/mybatis

private void assignKeysToParam(final Configuration configuration, ResultSet rs, final String[] keyProperties,
  Object param)
  throws SQLException {
 final TypeHandlerRegistry typeHandlerRegistry = configuration.getTypeHandlerRegistry();
 final ResultSetMetaData rsmd = rs.getMetaData();
 // Wrap the parameter in Collection to normalize the logic.
 Collection<?> paramAsCollection = null;
 if (param instanceof Object[]) {
  paramAsCollection = Arrays.asList((Object[]) param);
 } else if (!(param instanceof Collection)) {
  paramAsCollection = Arrays.asList(param);
 } else {
  paramAsCollection = (Collection<?>) param;
 }
 TypeHandler<?>[] typeHandlers = null;
 for (Object obj : paramAsCollection) {
  if (!rs.next()) {
   break;
  }
  MetaObject metaParam = configuration.newMetaObject(obj);
  if (typeHandlers == null) {
   typeHandlers = getTypeHandlers(typeHandlerRegistry, metaParam, keyProperties, rsmd);
  }
  populateKeys(rs, metaParam, keyProperties, typeHandlers);
 }
}

代码示例来源:origin: camunda/camunda-bpm-platform

typeHandlers = getTypeHandlers(typeHandlerRegistry, metaParam, keyProperties, rsmd);
populateKeys(rs, metaParam, keyProperties, typeHandlers);

相关文章