public Cache useCacheRef(String namespace) { if (namespace == null) { throw new BuilderException("cache-ref element requires a namespace attribute."); } try { unresolvedCacheRef = true; Cache cache = configuration.getCache(namespace); if (cache == null) { throw new IncompleteElementException("No cache for namespace '" + namespace + "' could be found."); } currentCache = cache; unresolvedCacheRef = false; return cache; } catch (IllegalArgumentException e) { throw new IncompleteElementException("No cache for namespace '" + namespace + "' could be found.", e); } }
public Cache useCacheRef(String namespace) { if (namespace == null) { throw new BuilderException("cache-ref element requires a namespace attribute."); } try { unresolvedCacheRef = true; Cache cache = configuration.getCache(namespace); if (cache == null) { throw new IncompleteElementException("No cache for namespace '" + namespace + "' could be found."); } currentCache = cache; unresolvedCacheRef = false; return cache; } catch (IllegalArgumentException e) { throw new IncompleteElementException("No cache for namespace '" + namespace + "' could be found.", e); } }
private List<ResultMap> getStatementResultMaps( String resultMap, Class<?> resultType, String statementId) { resultMap = applyCurrentNamespace(resultMap, true); List<ResultMap> resultMaps = new ArrayList<ResultMap>(); if (resultMap != null) { String[] resultMapNames = resultMap.split(","); for (String resultMapName : resultMapNames) { try { resultMaps.add(configuration.getResultMap(resultMapName.trim())); } catch (IllegalArgumentException e) { throw new IncompleteElementException("Could not find result map " + resultMapName, e); } } } else if (resultType != null) { ResultMap inlineResultMap = new ResultMap.Builder( configuration, statementId + "-Inline", resultType, new ArrayList<ResultMapping>(), null).build(); resultMaps.add(inlineResultMap); } return resultMaps; }
private List<ResultMap> getStatementResultMaps( String resultMap, Class<?> resultType, String statementId) { resultMap = applyCurrentNamespace(resultMap, true); List<ResultMap> resultMaps = new ArrayList<>(); if (resultMap != null) { String[] resultMapNames = resultMap.split(","); for (String resultMapName : resultMapNames) { try { resultMaps.add(configuration.getResultMap(resultMapName.trim())); } catch (IllegalArgumentException e) { throw new IncompleteElementException("Could not find result map " + resultMapName, e); } } } else if (resultType != null) { ResultMap inlineResultMap = new ResultMap.Builder( configuration, statementId + "-Inline", resultType, new ArrayList<>(), null).build(); resultMaps.add(inlineResultMap); } return resultMaps; }
private Node findSqlFragment(String refid, Properties variables) { refid = PropertyParser.parse(refid, variables); refid = builderAssistant.applyCurrentNamespace(refid, true); try { XNode nodeToInclude = configuration.getSqlFragments().get(refid); return nodeToInclude.getNode().cloneNode(true); } catch (IllegalArgumentException e) { throw new IncompleteElementException("Could not find SQL statement to include with refid '" + refid + "'", e); } }
private Node findSqlFragment(String refid, Properties variables) { refid = PropertyParser.parse(refid, variables); refid = builderAssistant.applyCurrentNamespace(refid, true); try { XNode nodeToInclude = configuration.getSqlFragments().get(refid); return nodeToInclude.getNode().cloneNode(true); } catch (IllegalArgumentException e) { throw new IncompleteElementException("Could not find SQL statement to include with refid '" + refid + "'", e); } }
private ParameterMap getStatementParameterMap( String parameterMapName, Class<?> parameterTypeClass, String statementId) { parameterMapName = applyCurrentNamespace(parameterMapName, true); ParameterMap parameterMap = null; if (parameterMapName != null) { try { parameterMap = configuration.getParameterMap(parameterMapName); } catch (IllegalArgumentException e) { throw new IncompleteElementException("Could not find parameter map " + parameterMapName, e); } } else if (parameterTypeClass != null) { List<ParameterMapping> parameterMappings = new ArrayList<>(); parameterMap = new ParameterMap.Builder( configuration, statementId + "-Inline", parameterTypeClass, parameterMappings).build(); } return parameterMap; }
private ParameterMap getStatementParameterMap( String parameterMapName, Class<?> parameterTypeClass, String statementId) { parameterMapName = applyCurrentNamespace(parameterMapName, true); ParameterMap parameterMap = null; if (parameterMapName != null) { try { parameterMap = configuration.getParameterMap(parameterMapName); } catch (IllegalArgumentException e) { throw new IncompleteElementException("Could not find parameter map " + parameterMapName, e); } } else if (parameterTypeClass != null) { List<ParameterMapping> parameterMappings = new ArrayList<ParameterMapping>(); parameterMap = new ParameterMap.Builder( configuration, statementId + "-Inline", parameterTypeClass, parameterMappings).build(); } return parameterMap; }
throw new IncompleteElementException("Could not find a parent resultmap with id '" + extend + "'");
throw new IncompleteElementException("Could not find a parent resultmap with id '" + extend + "'");
throw new IncompleteElementException("Cache-ref not yet resolved");
throw new IncompleteElementException("Cache-ref not yet resolved");