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

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


    /**
     * {@inheritDoc}
     */
    public boolean isRelationship() {
      IMapping mapping = resolver.getMapping();
      return (mapping != null) ? mapping.isRelationship() : (mappingType == MappingType.RELATIONSHIP);
    }
View Full Code Here


    /**
     * {@inheritDoc}
     */
    public boolean isTransient() {
      IMapping mapping = resolver.getMapping();
      return (mapping != null) ? mapping.isTransient() : false;
    }
View Full Code Here

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

    IMapping mapping = getMapping();

    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)) {

View Full Code Here

    public void visit(StateFieldPathExpression expression) {

      appendable = !expression.endsWithDot() || (appendableType == AppendableType.CLAUSE);

      if (appendable) {
        IMapping mapping = queryContext.getMapping(expression);

        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

      // Now traverse the path expression after the identification variable
      for (int index = 1, count = stateObject.itemsSize(); index < count; index++) {

        // Retrieve the mapping for the path at the current position
        IMapping mapping = stateObject.getMapping(index);

        if (mapping == null) {
          break;
        }

        // The name matches
        if (mapping.getName().equals(oldFieldName)) {

          // Make sure the field name is from the right type
          String parentTypeName = mapping.getParent().getType().getName();

          if (parentTypeName.equals(typeName)) {
            stateObject.setPath(index, newFieldName);
            break;
          }
View Full Code Here

        if (childResolver == null) {
          childResolver = new StateFieldResolver(resolver, path);
          resolver.addChild(path, childResolver);
        }

        IMapping mapping = childResolver.getMapping();

        // Invalid path expression
        if (mapping == null) {
          break;
        }

        // The name matches
        if (mapping.getName().equals(oldAttributeName)) {

          // Make sure the field name is from the right type
          String parentTypeName = mapping.getParent().getType().getName();

          if (parentTypeName.equals(typeName)) {
            int extraOffset = expression.toParsedText(0, index).length() + 1 /* '.' */;
            addTextEdit(expression, extraOffset, oldAttributeName, newAttributeName);
            break;
View Full Code Here

TOP

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

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.