Package org.eclipse.persistence.jpa.jpql.tools.spi

Examples of org.eclipse.persistence.jpa.jpql.tools.spi.IType


        return true;
      }

      // Determine if it's assignable to the desired type
      IType mappingType = value.getType();
      mappingType = queryContext.getTypeHelper().convertPrimitive(mappingType);
      return mappingType.isAssignableTo(type);
    }
View Full Code Here


      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)) {
View Full Code Here

  @Override
  protected IType resolveType() {

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

    // For a collection type, return the first type parameter
    if (typeHelper.isCollectionType(type)) {

      ITypeDeclaration[] typeParameters = typeDeclaration.getTypeParameters();
View Full Code Here

    // so we can't resolve the type
    if (!expression.endsWithDot()) {

      // Check first to see if it's an enum type
      String path = expression.toActualText();
      IType type = queryContext.getTypeRepository().getEnumType(path);

      if (type != null) {
        resolver = buildEnumResolver(expression, type, path);
      }
      else {
View Full Code Here

    // so we can't resolve the type
    if (!expression.endsWithDot()) {

      // Check first to see if it's an enum type
      String path = expression.toActualText();
      IType type = queryContext.getTypeRepository().getEnumType(path);

      if (type != null) {
        resolver = buildEnumResolver(expression, type, path);
      }
      else {
View Full Code Here

      String path = expression.toString();

      if (path.equals(oldEnumConstant)) {

        // Check to see if the path is actually a fully qualified enum constant
        IType type = managedTypeProvider.getTypeRepository().getEnumType(path);

        // If it is not null, then it's a fully qualified enum constant
        if (type != null) {
          addTextEdit(expression, oldEnumConstant, newEnumConstant);
        }
View Full Code Here

  }

  protected Filter<Expression> buildCollectionCompoundTypeFilter() {
    return new Filter<Expression>() {
      public boolean accept(Expression expression) {
        IType type = queryContext.getType(expression);
        TypeHelper typeHelper = queryContext.getTypeHelper();
        return typeHelper.isCollectionType(type) ||
               typeHelper.isMapType(type);
      }
    };
View Full Code Here

                                                Filter<IMapping> filter) {

    // Wrap the filter with another Filter that will make sure only the
    // mappings with the right type will be accepted, for instance, AVG(e.|
    // can only accept state fields with a numeric type
    IType type = getAcceptableType(expression.getParent());

    // No need to filter
    if (type == null) {
      return filter;
    }
View Full Code Here

  }

  protected Filter<Expression> buildNonCollectionCompoundTypeFilter() {
    return new Filter<Expression>() {
      public boolean accept(Expression expression) {
        IType type = queryContext.getType(expression);
        TypeHelper typeHelper = queryContext.getTypeHelper();
        return !typeHelper.isCollectionType(type) &&
               !typeHelper.isMapType(type);
      }
    };
View Full Code Here

          // the possible abstract schema names
          if (!expression.hasEntityType()) {

            // If the type of the path expression is resolvable,
            // then filter the abstract schema types
            IType type = queryContext.getType(collectionValuedPathExpression);

            if (type.isResolvable()) {
              addEntities(type);
            }
            else {
              addEntities();
            }
          }
        }
      }

      // After "AS "
      if (expression.hasAs() &&
          expression.hasSpaceAfterAs()) {

        length += AS.length() + SPACE_LENGTH;

        // Right after "AS "
        if (position == length) {
          // If the type of the path expression is resolvable,
          // then filter the abstract schema types
          IType type = queryContext.getType(expression.getCollectionValuedPathExpression());

          if (type.isResolvable()) {
            addEntities(type);
          }
          else {
            addEntities();
          }
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.jpa.jpql.tools.spi.IType

Copyright © 2018 www.massapicom. 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.