Examples of TypeHandler


Examples of org.apache.ibatis.type.TypeHandler

    return resultMap;
  }

  protected Object getDiscriminatorValue(ResultSet rs, Discriminator discriminator) throws SQLException {
    final ResultMapping resultMapping = discriminator.getResultMapping();
    final TypeHandler typeHandler = resultMapping.getTypeHandler();
    if (typeHandler != null) {
      return typeHandler.getResult(rs, resultMapping.getColumn());
    } else {
      throw new ExecutorException("No type handler could be found to map the property '" + resultMapping.getProperty() + "' to the column '" + resultMapping.getColumn() + "'.  One or both of the types, or the combination of types is not supported.");
    }
  }
View Full Code Here

Examples of org.apache.ibatis.type.TypeHandler

      Integer numericScale) {
    resultMap = applyCurrentNamespace(resultMap);

    // Class parameterType = parameterMapBuilder.type();
    Class javaTypeClass = resolveParameterJavaType(parameterType, property, javaType);
    TypeHandler typeHandlerInstance = (TypeHandler) resolveInstance(typeHandler);

    ParameterMapping.Builder builder = new ParameterMapping.Builder(configuration, property, javaTypeClass);
    builder.jdbcType(jdbcType);
    builder.resultMapId(resultMap);
    builder.mode(parameterMode);
View Full Code Here

Examples of org.apache.ibatis.type.TypeHandler

        String javaType = child.getStringAttribute("javaType");
        String jdbcType = child.getStringAttribute("jdbcType");
        String handler = child.getStringAttribute("handler");

        Class javaTypeClass = resolveClass(javaType);
        TypeHandler typeHandlerInstance = (TypeHandler) resolveClass(handler).newInstance();

        if (jdbcType == null) {
          typeHandlerRegistry.register(javaTypeClass, typeHandlerInstance);
        } else {
          typeHandlerRegistry.register(javaTypeClass, resolveJdbcType(jdbcType), typeHandlerInstance);
View Full Code Here

Examples of org.apache.ibatis.type.TypeHandler

      Class typeHandler,
      List<ResultFlag> flags) {
    // Class resultType = resultMapBuilder.type();
    nestedResultMap = applyCurrentNamespace(nestedResultMap);
    Class javaTypeClass = resolveResultJavaType(resultType, property, javaType);
    TypeHandler typeHandlerInstance = (TypeHandler) resolveInstance(typeHandler);

    List<ResultMapping> composites = parseCompositeColumnName(column);
    if (composites.size() > 0) {
      ResultMapping first = composites.get(0);
      column = first.getColumn();
View Full Code Here

Examples of org.apache.ibatis.type.TypeHandler

  private void createRowKeyForMappedProperties(ResultSet rs, CacheKey cacheKey, List<ResultMapping> resultMappings) {
    for (ResultMapping resultMapping : resultMappings) {
      if (resultMapping.getNestedQueryId() == null && resultMapping.getNestedResultMapId() == null) {
        final String column = resultMapping.getColumn();
        final TypeHandler th = resultMapping.getTypeHandler();
        if (column != null) {
          try {
            final Object value = th.getResult(rs, column);
            if (value != null) {
              cacheKey.update(column);
              cacheKey.update(value);
            }
          } catch (Exception e) {
View Full Code Here

Examples of org.apache.ibatis.type.TypeHandler

              value = configuration.newMetaObject(value).getValue(propertyName.substring(prop.getName().length()));
            }
          } else {
            value = metaObject == null ? null : metaObject.getValue(propertyName);
          }
          TypeHandler typeHandler = parameterMapping.getTypeHandler();
          if (typeHandler == null) {
            throw new ExecutorException("There was no TypeHandler found for parameter " + propertyName + " of statement " + mappedStatement.getId());
          }
          typeHandler.setParameter(ps, i + 1, value, parameterMapping.getJdbcType());
        }
      }
    }
  }
View Full Code Here

Examples of org.apache.ibatis.type.TypeHandler

        String javaType = child.getStringAttribute("javaType");
        String jdbcType = child.getStringAttribute("jdbcType");
        String handler = child.getStringAttribute("handler");

        Class javaTypeClass = resolveClass(javaType);
        TypeHandler typeHandlerInstance = (TypeHandler) resolveClass(handler).newInstance();

        if (jdbcType == null) {
          typeHandlerRegistry.register(javaTypeClass, typeHandlerInstance);
        } else {
          typeHandlerRegistry.register(javaTypeClass, resolveJdbcType(jdbcType), typeHandlerInstance);
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.type.TypeHandler

    public static Vector<Hashtable<String, Object>> getXmlRpcTypeHandlers(List<TypeHandler> typeHandlers) {
        Vector<Hashtable<String, Object>> handlersVector = new Vector<Hashtable<String, Object>>();

        if (typeHandlers != null && typeHandlers.size() > 0) {
            for (Iterator<TypeHandler> i = typeHandlers.iterator(); i.hasNext();) {
                TypeHandler typeHandler = i.next();
                handlersVector.add(getXmlRpcTypeHandler(typeHandler));
            }
        }

        return handlersVector;
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.type.TypeHandler

        return handlers;
    }
   
    public static TypeHandler getTypeHandlerFromXmlRpc(
            Hashtable<String, Object> typeHandlerHash) {
        TypeHandler typeHandler = GenericFileManagerObjectFactory
            .getTypeHandlerFromClassName((String) typeHandlerHash.get("className"));
        typeHandler.setElementName((String) typeHandlerHash.get("elementName"));
        return typeHandler;
    }
View Full Code Here

Examples of org.apache.oodt.cas.filemgr.structs.type.TypeHandler

                for (int i = 0; i < handlerNodes.getLength(); i++) {
                    Node handlerNode = handlerNodes.item(i);
                    String handlerClass = ((Element) handlerNode).getAttribute("class");
                    String elementName = ((Element) handlerNode).getAttribute("elementName");
                    try {
                        TypeHandler typeHandler = (TypeHandler) Class.forName(handlerClass).newInstance();
                        typeHandler.setElementName(elementName);
                        handlers.add(typeHandler);
                    }catch (Exception e) {
                        e.printStackTrace();
                        LOG.log(Level.WARNING, "Failed to load handler for ProductType [name = " + name
                                + "] and element [name = " + elementName + "] : " + e.getMessage());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.