Examples of TypeHelper


Examples of org.eclipse.persistence.jpa.jpql.TypeHelper

   */
  private boolean isIntegralType(Expression expression) {

    if (isNumericType(expression)) {

      TypeHelper typeHelper = getTypeHelper();
      IType type = getType(expression);

      if (type != typeHelper.unknownType()) {
        return typeHelper.isIntegralType(type);
      }
    }

    return false;
  }
View Full Code Here

Examples of org.eclipse.persistence.jpa.jpql.tools.TypeHelper

    if (mapping == null) {
      return null;
    }

    TypeHelper typeHelper = getTypeHelper();
    ITypeDeclaration typeDeclaration = mapping.getTypeDeclaration();
    IType type = typeDeclaration.getType();

    // Collection type cannot be traversed
    // Example: SELECT e.employees. FROM Employee e where employees is a collection,
    // it cannot be traversed
    if (typeHelper.isCollectionType(type)) {
      return null;
    }

    // Primitive types cannot have a managed type
    if (typeHelper.isPrimitiveType(type)) {
      return null;
    }

    // Retrieve the corresponding managed type for the mapping's type
    return getManagedTypeProvider().getManagedType(type);
View Full Code Here

Examples of speculoos.utils.TypeHelper

   * method.
   *
   * @see speculoos.core.Mapper#map(java.lang.Object, java.util.Map)
   */
  public Object map(Object input, Map param) throws MapperException {
    TypeHelper th = TypeHelper.instance;
    StringBuffer sb = new StringBuffer();
    sb.append("(&");
    BeanInfo info;
    try {
      info = Introspector.getBeanInfo(input.getClass());
    } catch (IntrospectionException e) {
      throw new MapperException(getName()
          + ": cannot access fields info from Introspector", e);
    }
    PropertyDescriptor[] props = info.getPropertyDescriptors();
    for (int i = 0; i < props.length; i++) {
      PropertyDescriptor p = props[i];
      String n = (String) outputMap.get(p.getName());
      if (n == null)
        continue;
      Object o = th.get(input, p.getName());
      /* special handling for collections */
      if (o != null)
        if (o instanceof Collection) {
          for (Iterator it = ((Collection) o).iterator(); it
              .hasNext();)
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.