Examples of ITypeDeclaration


Examples of org.eclipse.persistence.jpa.jpql.spi.ITypeDeclaration

   * {@inheritDoc}
   */
  @Override
  protected IType buildType() {

    ITypeDeclaration typeDeclaration = getTypeDeclaration();

    if (getTypeHelper().isMapType(typeDeclaration.getType())) {
      ITypeDeclaration[] typeParameters = typeDeclaration.getTypeParameters();

      if (typeParameters.length > 0) {
        return typeParameters[0].getType();
      }
    }
View Full Code Here

Examples of org.eclipse.persistence.jpa.jpql.spi.ITypeDeclaration

  /**
   * {@inheritDoc}
   */
  public boolean isTypeDeclarationAssignableTo(Object typeDeclaration1, Object typeDeclaration2) {

    ITypeDeclaration declaration1 = (ITypeDeclaration) typeDeclaration1;
    ITypeDeclaration declaration2 = (ITypeDeclaration) typeDeclaration2;

    // One is an array but not the other one
    if (declaration1.isArray() && !declaration2.isArray() ||
       !declaration1.isArray() &&  declaration2.isArray()) {

      return false;
    }

    // Check the array dimensionality
    if (declaration1.isArray()) {
      return declaration1.getDimensionality() == declaration2.getDimensionality();
    }

    return isAssignableTo(declaration1.getType(), declaration2.getType());
  }
View Full Code Here

Examples of org.eclipse.persistence.jpa.jpql.spi.ITypeDeclaration

   * {@inheritDoc}
   */
  @Override
  protected IType resolveType() {

    ITypeDeclaration typeDeclaration = getTypeDeclaration();

    if (getTypeHelper().isMapType(typeDeclaration.getType())) {
      ITypeDeclaration[] typeParameters = typeDeclaration.getTypeParameters();

      if (typeParameters.length > 0) {
        return typeParameters[0].getType();
      }
    }
View Full Code Here

Examples of org.eclipse.persistence.jpa.jpql.spi.ITypeDeclaration

   * {@inheritDoc}
   */
  @Override
  IType buildType() {

    ITypeDeclaration typeDeclaration = getTypeDeclaration();

    if (getTypeHelper().isMapType(typeDeclaration.getType())) {
      ITypeDeclaration[] typeParameters = typeDeclaration.getTypeParameters();

      if (typeParameters.length > 0) {
        return typeParameters[0].getType();
      }
    }
View Full Code Here

Examples of org.eclipse.persistence.jpa.jpql.spi.ITypeDeclaration

    if (type != null) {
      return type;
    }

    ITypeDeclaration typeDeclaration = getTypeDeclaration();
    type = typeDeclaration.getType();

    // For a collection type, return the first type parameter
    if (getTypeHelper().isCollectionType(type)) {
      ITypeDeclaration[] typeParameters = typeDeclaration.getTypeParameters();
      if (typeParameters.length > 0) {
        type = typeParameters[0].getType();
      }
    }
    // For a map type, by default the value is the actual type to return
    else if (getTypeHelper().isMapType(type)) {
      ITypeDeclaration[] typeParameters = typeDeclaration.getTypeParameters();
      if (typeParameters.length == 2) {
        type = typeParameters[1].getType();
      }
    }
View Full Code Here

Examples of org.eclipse.persistence.jpa.jpql.spi.ITypeDeclaration

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

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

    // Collection type cannot be traversed
    if (getTypeHelper().isCollectionType(type)) {
      ITypeDeclaration[] typeParameters = typeDeclaration.getTypeParameters();
      if (typeParameters.length == 0) {
        return null;
      }
      type = typeParameters[0].getType();
    }
View Full Code Here

Examples of org.eclipse.persistence.jpa.jpql.spi.ITypeDeclaration

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

    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 (getTypeHelper().isCollectionType(type)) {
View Full Code Here

Examples of org.eclipse.persistence.jpa.jpql.spi.ITypeDeclaration

   * {@inheritDoc}
   */
  @Override
  IType buildType() {

    ITypeDeclaration typeDeclaration = getTypeDeclaration();

    if (getTypeHelper().isMapType(typeDeclaration.getType())) {
      ITypeDeclaration[] typeParameters = typeDeclaration.getTypeParameters();

      if (typeParameters.length == 2) {
        return typeParameters[1].getType();
      }
    }
View Full Code Here

Examples of org.eclipse.persistence.jpa.jpql.spi.ITypeDeclaration

      Expression childExpression = expression.getExpression();
      String variableName = queryContext.literal(childExpression, LiteralType.IDENTIFICATION_VARIABLE);

      // Retrieve the identification variable's type without traversing the type parameters
      if (ExpressionTools.stringIsNotEmpty(variableName)) {
        ITypeDeclaration typeDeclaration = getTypeDeclaration(childExpression);

        if (!getTypeHelper().isMapType(typeDeclaration.getType())) {
          addProblem(
            childExpression,
            EncapsulatedIdentificationVariableExpression_NotMapValued,
            expression.getIdentifier()
          );
View Full Code Here

Examples of org.eclipse.persistence.jpa.jpql.spi.ITypeDeclaration

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

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

    // Collection type cannot be traversed
    if (getTypeHelper().isCollectionType(type)) {
      ITypeDeclaration[] typeParameters = typeDeclaration.getTypeParameters();
      if (typeParameters.length == 0) {
        return null;
      }
      type = typeParameters[0].getType();
    }
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.