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

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


   * {@inheritDoc}
   */
  @Override
  ITypeDeclaration buildTypeDeclaration() {

    IType type = getEnumType();

    if (type != null) {
      enumType = Boolean.TRUE;
      return type.getTypeDeclaration();
    }
    else {
      enumType = Boolean.FALSE;
      return super.buildTypeDeclaration();
    }
View Full Code Here


    // Now find the closest type for each location
    TreeSet<IType> types = new TreeSet<IType>(buildNumericTypeComparator());

    for (InputParameter inputParameter : inputParameters) {
      IType type = queryContext.getParameterType(inputParameter);

      // A type is ignored if it cannot be determined and it can't affect the calculation
      // if the same input parameter is used elsewhere. Example:
      // SELECT e FROM Employee e WHERE :name IS NOT NULL AND e.name = 'JPQL'
      // The first :name cannot be used to calculate the type
      if (type.isResolvable()) {
        types.add(type);
      }
    }

    return types.isEmpty() ? getTypeHelper().objectType() : types.first();
View Full Code Here

   * @return The result type of the JPQL query if it could accurately be calculated or the
   * {@link IClass} for <code>Object</code> if it could not be calculated
   */
  protected IType getResultType() {

    IType type = queryContext.getType(getJPQLExpression());

    if (!type.isResolvable()) {
      type = getTypeHelper().objectType();
    }

    return type;
  }
View Full Code Here

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

    IType type = getTypeDeclaration().getType();
    TypeHelper helper = getTypeHelper();

    // Integral types: int/Integer, long/Long => the result is a Long
    if (helper.isIntegralType(type)) {
      return helper.longType();
    }

    // Floating types: float/Float, double/Double => the result is a Double
    if (helper.isFloatingType(type)) {
      return helper.doubleType();
    }

    // BigInteger, the result is the same
    IType bigIntegerType = helper.bigInteger();

    if (type.equals(bigIntegerType)) {
      return bigIntegerType;
    }

    // BigDecimal, the result is the same
    IType bigDecimalType = helper.bigDecimal();

    if (type.equals(bigDecimalType)) {
      return bigDecimalType;
    }

View Full Code Here

    if (type1.equals(type2)) {
      return 0;
    }

    // Object type
    IType type = typeHelper.objectType();
    if (type1.equals(type)) return -1;
    if (type2.equals(type)) return  1;

    // Double
    type = typeHelper.doubleType();
View Full Code Here

  @Override
  IType buildType() {

    List<IType> types = new ArrayList<IType>(resolvers.size());
    TypeHelper helper = getTypeHelper();
    IType unresolvableType = helper.unknownType();

    // Convert any primitive types into its Class type and any non-number into Object
    for (Resolver typeResolver : resolvers) {

      IType type = typeResolver.getType();

      // Only a resolvable type will be added to the list
      if (type != unresolvableType) {
        // Non-numeric type cannot be added
        if (!helper.isNumericType(type)) {
View Full Code Here

   */
  @Override
  IType buildType() {

    TypeHelper helper = getTypeHelper();
    IType unknownType = helper.unknownType();
    IType type = null;

    for (int index = 0, count = resolvers.size(); index < count; index++) {
      IType anotherType = resolvers.get(index).getType();

      if (anotherType == unknownType) {
        continue;
      }

View Full Code Here

    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

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

    IType type = getParentType();

    // Anything else is an invalid type
    if (!getTypeHelper().isNumericType(type)) {
      type = getTypeHelper().objectType();
    }
View Full Code Here

   */
  @Override
  IType buildType() {

    // Check first to see if the path expression is actually representing an enum constant
    IType type = getEnumType();

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

View Full Code Here

TOP

Related Classes of org.eclipse.persistence.jpa.jpql.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.