MES项目源码

  • M0_943790
    了解作者
  • 5.5MB
    文件大小
  • 文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-04-11 06:18
    上传日期
制造业MES项目源码上花钱买的,eclipse上可以直接导入有借鉴价值。配置tomcat7/8可以运行。
制造业MES源码.7z
内容介绍
/* * Copyright 2009-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.ibatis.executor.resultset; import java.sql.CallableStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.Map.Entry; import org.apache.ibatis.cache.CacheKey; import org.apache.ibatis.executor.ErrorContext; import org.apache.ibatis.executor.Executor; import org.apache.ibatis.executor.ExecutorException; import org.apache.ibatis.executor.loader.ResultLoader; import org.apache.ibatis.executor.loader.ResultLoaderMap; import org.apache.ibatis.executor.parameter.ParameterHandler; import org.apache.ibatis.executor.result.DefaultResultContext; import org.apache.ibatis.executor.result.DefaultResultHandler; import org.apache.ibatis.mapping.BoundSql; import org.apache.ibatis.mapping.Discriminator; import org.apache.ibatis.mapping.MappedStatement; import org.apache.ibatis.mapping.ParameterMapping; import org.apache.ibatis.mapping.ParameterMode; import org.apache.ibatis.mapping.ResultMap; import org.apache.ibatis.mapping.ResultMapping; import org.apache.ibatis.reflection.MetaClass; import org.apache.ibatis.reflection.MetaObject; import org.apache.ibatis.reflection.factory.ObjectFactory; import org.apache.ibatis.session.AutoMappingBehavior; import org.apache.ibatis.session.Configuration; import org.apache.ibatis.session.ResultContext; import org.apache.ibatis.session.ResultHandler; import org.apache.ibatis.session.RowBounds; import org.apache.ibatis.type.TypeHandler; import org.apache.ibatis.type.TypeHandlerRegistry; /** * @author Clinton Begin * @author Eduardo Macarron */ public class DefaultResultSetHandler implements ResultSetHandler { private static final Object NO_VALUE = new Object(); private final Executor executor; private final Configuration configuration; private final MappedStatement mappedStatement; private final RowBounds rowBounds; private final ParameterHandler parameterHandler; private final ResultHandler resultHandler; private final BoundSql boundSql; private final TypeHandlerRegistry typeHandlerRegistry; private final ObjectFactory objectFactory; // nested resultmaps private final Map<CacheKey, Object> nestedResultObjects = new HashMap<CacheKey, Object>(); private final Map<CacheKey, Object> ancestorObjects = new HashMap<CacheKey, Object>(); private final Map<String, String> ancestorColumnPrefix = new HashMap<String, String>(); public static final String BATCHSAVE = ".BaseMapper."; // multiple resultsets private final Map<String, ResultMapping> nextResultMaps = new HashMap<String, ResultMapping>(); private final Map<CacheKey, List<PendingRelation>> pendingRelations = new HashMap<CacheKey, List<PendingRelation>>(); private static class PendingRelation { public MetaObject metaObject; public ResultMapping propertyMapping; } public DefaultResultSetHandler(Executor executor, MappedStatement mappedStatement, ParameterHandler parameterHandler, ResultHandler resultHandler, BoundSql boundSql, RowBounds rowBounds) { this.executor = executor; this.configuration = mappedStatement.getConfiguration(); this.mappedStatement = mappedStatement; this.rowBounds = rowBounds; this.parameterHandler = parameterHandler; this.boundSql = boundSql; this.typeHandlerRegistry = configuration.getTypeHandlerRegistry(); this.objectFactory = configuration.getObjectFactory(); this.resultHandler = resultHandler; } // // HANDLE OUTPUT PARAMETER // public void handleOutputParameters(CallableStatement cs) throws SQLException { final Object parameterObject = parameterHandler.getParameterObject(); final MetaObject metaParam = configuration.newMetaObject(parameterObject); final List<ParameterMapping> parameterMappings = boundSql.getParameterMappings(); for (int i = 0; i < parameterMappings.size(); i++) { final ParameterMapping parameterMapping = parameterMappings.get(i); if (parameterMapping.getMode() == ParameterMode.OUT || parameterMapping.getMode() == ParameterMode.INOUT) { if (ResultSet.class.equals(parameterMapping.getJavaType())) { handleRefCursorOutputParameter((ResultSet) cs.getObject(i + 1), parameterMapping, metaParam); } else { final TypeHandler<?> typeHandler = parameterMapping.getTypeHandler(); metaParam.setValue(parameterMapping.getProperty(), typeHandler.getResult(cs, i + 1)); } } } } private void handleRefCursorOutputParameter(ResultSet rs, ParameterMapping parameterMapping, MetaObject metaParam) throws SQLException { try { final String resultMapId = parameterMapping.getResultMapId(); final ResultMap resultMap = configuration.getResultMap(resultMapId); final DefaultResultHandler resultHandler = new DefaultResultHandler(objectFactory); final ResultSetWrapper rsw = new ResultSetWrapper(rs, configuration); handleRowValues(rsw, resultMap, resultHandler, new RowBounds(), null); metaParam.setValue(parameterMapping.getProperty(), resultHandler.getResultList()); } finally { closeResultSet(rs); // issue #228 (close resultsets) } } // // HANDLE RESULT SETS // @SuppressWarnings({ "unchecked", "rawtypes" }) public List<Object> handleResultSets(Statement stmt) throws SQLException { ErrorContext.instance().activity("handling results").object(mappedStatement.getId()); final List<Object> multipleResults = new ArrayList<Object>(); int resultSetCount = 0; ResultSetWrapper rsw = getFirstResultSet(stmt); List<ResultMap> resultMaps = mappedStatement.getResultMaps(); int resultMapCount = resultMaps.size(); validateResultMapsCount(rsw, resultMapCount); while (rsw != null && resultMapCount > resultSetCount) { ResultMap resultMap = resultMaps.get(resultSetCount); handleResultSet(rsw, resultMap, multipleResults, null); rsw = getNextResultSet(stmt); cleanUpAfterHandlingResultSet(); resultSetCount++; } String[] resultSets = mappedStatement.getResulSets(); if (resultSets != null) { while (rsw != null && resultSetCount < resultSets.length) { ResultMapping parentMapping = nextResultMaps.get(resultSets[resultSetCount]); if (parentMapping != null) { String nestedResultMapId = parentMapping.getNestedResultMapId(); ResultMap resultMap = configuration.getResultMap(nestedResultMapId); handleResultSet(rsw, resultMap, null, parentMapping); } rsw = getNextResultSet(stmt); cleanUpAfterHandlingResultSet(); resultSetCount++; } } List<Object> lists = collapseSingleResultList(multipleResults); if(mappedStatement.getId().indexOf(BATCHSAVE)>-1){ try { List<Object> mlist = new ArrayList<Object>(); Object parameterObject = boundSql.getParameterObject(); Map map = (Map) parameterObject; Object o3 = null; if(null!=map){ o3=map.get("param3"); } for (Object object : lists) { Map<String, Object> m = (Map) object; Object o = null; if(null!=o3){ Class fm = (Class) o3; o= fm.newInstance(); }else{ o = (Object) parameterObject.ge
评论
    相关推荐
    • eclipse tomcat插件
      eclipse tomcat插件 及配置方法 好用
    • Eclipse tomcat插件
      Eclipse tomcat插件,解压后放入eclipse-plugins目录下即可
    • Eclipse Tomcat插件
      Eclipse Tomcat插件 解压出来得到 com.sysdeo.eclipse.tomcat_3.2.1 将com.sysdeo.eclipse.tomcat_3.2.1复制到eclipse的plugins目录下,比如:C:\Program Files\eclipse\plugins里面。然后重新启动eclipse,在...
    • Eclipse Tomcat Plugins
      解决Eclipse4.6 无法使用V331包的问题 解压后拖入Eclips->drop...文件夹中
    • Eclipse Tomcat 插件
      com.sysdeo.eclipse.tomcat_3.1.0.rar
    • Sysdeo Eclipse Tomcat
      Sysdeo Eclipse Tomcat
    • eclipse tomcat插件
      eclipse tomcat插件.。
    • eclipse tomcat插件
      eclipse tomcat插件 eclipse tomcat 插件, eclipse4.6.3
    • Eclipse tomcat插件
      这是一个eclipsetomcat插件,使用方法是在eclipse中help的install new software中
    • Eclipse Tomcat Plugin 9.1.2
      Eclipse Tomcat Plugin最新插件,官方下载,解决在线安装报错问题, 支持以下版本Eclipse, 请分别将plugin和features内的jar包放入eclipse内相同文件夹内即可,记得重启eclipse!! Oxygen (4.7) Neon (4.6) Mars ...