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

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


      // The position is after the last dot, check for enum constants
      if (position > lastDotIndex) {

        // Retrieve the enum type if the path up to the last dot is a fully qualified enum type
        String enumType = expression.toParsedText().substring(0, lastDotIndex);
        IType type = queryContext.getType(enumType);

        // The path expression before the last dot is an enum type
        if (type.isResolvable() && type.isEnum()) {
          enumConstant = true;

          // Now retrieve the portion of the enum constant based on the cursor position
          String word = text.substring(lastDotIndex + 1, position);
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

    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

        if (mapping == null) {
          appendable = false;
        }
        else {
          IType type = mapping.getType();

          switch (appendableType) {
            case ARITHMETIC: {
              // e.name (String) cannot be followed by +,-,/,*
              // e.age (int) can be followed by an arithmetic operator
View Full Code Here

        return true;
      }

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

    if (hasAnnotation(annotations, Version.class)) {
      return VERSION;
    }

    // Default
    IType type = getType();
    TypeHelper typeHelper = getTypeRepository().getTypeHelper();

    // M:M
    if (typeHelper.isCollectionType(type) ||
        typeHelper.isMapType(type)) {
View Full Code Here

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

    IType type = getParentType();

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

   */
  @Override
  protected IType buildType() {

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

    // For a collection type, return the first type parameter
    if (getTypeHelper().isCollectionType(type)) {
      ITypeDeclaration[] typeParameters = typeDeclaration.getTypeParameters();
      if (typeParameters.length > 0) {
View Full Code Here

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

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

   */
  @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

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.