Examples of ITypeDeclaration


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

   * {@inheritDoc}
   */
  @Override
  protected IManagedType resolveManagedType(IMapping mapping) {

    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
  protected 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

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

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

    // Collection type cannot be traversed
    if (typeHelper.isCollectionType(type)) {

      ITypeDeclaration[] typeParameters = typeDeclaration.getTypeParameters();

      if (typeParameters.length == 0) {
        return null;
      }
View Full Code Here

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

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

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

   */
  @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();

      if (typeParameters.length > 0) {
        type = typeParameters[0].getType();
      }
    }
    // For a map type, by default the value is the actual type to return
    else if (typeHelper.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.tools.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.tools.spi.ITypeDeclaration

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

    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.tools.spi.ITypeDeclaration

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

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

   */
  @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();

      if (typeParameters.length > 0) {
        type = typeParameters[0].getType();
      }
    }
    // For a map type, by default the value is the actual type to return
    else if (typeHelper.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.tools.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
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.