All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.eclipse.persistence.jpa.jpql.tools.DefaultBasicRefactoringTool Maven / Gradle / Ivy

There is a newer version: 4.0.3
Show newest version
/*******************************************************************************
 * Copyright (c) 2012, 2014 Oracle and/or its affiliates. All rights reserved.
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
 * which accompanies this distribution.
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
 * and the Eclipse Distribution License is available at
 * http://www.eclipse.org/org/documents/edl-v10.php.
 *
 * Contributors:
 *     Oracle - initial API and implementation
 *
 ******************************************************************************/
package org.eclipse.persistence.jpa.jpql.tools;

import org.eclipse.persistence.jpa.jpql.parser.JPQLGrammar;
import org.eclipse.persistence.jpa.jpql.tools.spi.IManagedTypeProvider;

/**
 * This utility class provides basic refactoring support. This version does not changes the {@link
 * org.eclipse.persistence.jpa.jpql.tools.model.query.StateObject StateObject} but rather gather the
 * changes in {@link RefactoringDelta} and it is the responsibility of the invoker to the actual
 * change.
 * 

* Provided functionality: *

    *
  • Renaming an identification variable;
  • *
  • Renaming a state field or collection-valued field;
  • *
  • Renaming an entity name;
  • *
  • Renaming a {@link Class} name (e.g.: in constructor expression);
  • *
  • Renaming an {@link Enum} constant.
  • *
*

* Provisional API: This interface is part of an interim API that is still under development and * expected to change significantly before reaching stability. It is available at this early stage * to solicit feedback from pioneering adopters on the understanding that any code that uses this * API will almost certainly be broken (repeatedly) as the API evolves. * * @see EclipseLinkBasicRefactoringTool * * @version 2.4 * @since 2.4 * @author Pascal Filion */ public class DefaultBasicRefactoringTool extends BasicRefactoringTool { /** * Creates a new DefaultBasicRefactoringTool. * * @param jpqlQuery The JPQL query to manipulate * @param jpqlGrammar The {@link JPQLGrammar} that was used to parse the JPQL query * @param managedTypeProvider The external form of a provider that gives access to the JPA metadata */ public DefaultBasicRefactoringTool(CharSequence jpqlQuery, JPQLGrammar jpqlGrammar, IManagedTypeProvider managedTypeProvider) { super(jpqlQuery, jpqlGrammar, managedTypeProvider); } /** * Creates a new DefaultBasicRefactoringTool. * * @param jpqlFragment The JPQL query to manipulate or a single JPQL fragment, which is parsed * using the JPQL query BNF identifier by the given ID * @param jpqlGrammar The {@link JPQLGrammar} that was used to parse the JPQL fragment * @param managedTypeProvider The external form of a provider that gives access to the JPA metadata * @param jpqlQueryBNFId The unique identifier of the {@link * org.eclipse.persistence.jpa.jpql.parser.JPQLQueryBNF JPQLQueryBNF} that determines how to parse the JPQL fragment */ public DefaultBasicRefactoringTool(CharSequence jpqlFragment, JPQLGrammar jpqlGrammar, IManagedTypeProvider managedTypeProvider, String jpqlQueryBNFId) { super(jpqlFragment, jpqlGrammar, managedTypeProvider, jpqlQueryBNFId); } /** * {@inheritDoc} */ @Override protected JPQLQueryContext buildJPQLQueryContext() { return new DefaultJPQLQueryContext(getGrammar()); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy