diff options
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java')
91 files changed, 0 insertions, 5798 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AccessType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AccessType.java deleted file mode 100644 index e139450a10..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AccessType.java +++ /dev/null @@ -1,67 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0; - -/** - * Corresponds to the JPA 2.0 enum - * javax.persistence.AccessType - * <p> - * 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. - * - * @version 2.3 - * @since 2.0 - */ -// TODO move to jpa2 package? currently intertwined with 1.0 code... -public enum AccessType { - - FIELD(JPA2_0.ACCESS_TYPE__FIELD), - PROPERTY(JPA2_0.ACCESS_TYPE__PROPERTY); - - - private String javaAnnotationValue; - - AccessType(String javaAnnotationValue) { - if (javaAnnotationValue == null) { - throw new NullPointerException(); - } - this.javaAnnotationValue = javaAnnotationValue; - } - - public String getJavaAnnotationValue() { - return this.javaAnnotationValue; - } - - - // ********** static methods ********** - - public static AccessType fromJavaAnnotationValue(Object javaAnnotationValue) { - return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue); - } - - private static AccessType fromJavaAnnotationValue_(Object javaAnnotationValue) { - for (AccessType accessType : AccessType.values()) { - if (accessType.getJavaAnnotationValue().equals(javaAnnotationValue)) { - return accessType; - } - } - return null; - } - - public static String toJavaAnnotationValue(AccessType accessType) { - return (accessType == null) ? null : accessType.getJavaAnnotationValue(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Annotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Annotation.java deleted file mode 100644 index c734cda06d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/Annotation.java +++ /dev/null @@ -1,91 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import java.util.Map; -import org.eclipse.jdt.core.dom.CompilationUnit; - -/** - * Common Java resource annotation behavior - * <p> - * 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. - * - * @version 2.3 - * @since 2.0 - */ -public interface Annotation - extends JavaResourceNode -{ - /** - * Return the annotation's fully qualified name, as opposed to the value of - * the annotation's <code>name</code> element. For example:<pre> - * @com.foo.Bar(name="Thomas") - * </pre> - * <code>#getAnnotationName()</code> will return <code>"com.foo.Bar"</code>. - * In typical subclasses, <code>#getName()</code> would return - * <code>"Thomas"</code>. - * - * @see JPA - */ - String getAnnotationName(); - - /** - * Return the corresponding JDT DOM annotation from the specified - * AST compilation unit. - */ - org.eclipse.jdt.core.dom.Annotation getAstAnnotation(CompilationUnit astRoot); - - /** - * Create and add the corresponding Java annotation to the JDT DOM. - */ - void newAnnotation(); - - /** - * Remove the corresponding Java annotation from the JDT DOM. - */ - void removeAnnotation(); - - /** - * Return whether all the annotation's member values are <code>null</code>; - * implying the annotation can be removed if it has no semantic value as a - * marker annotation. - */ - boolean isUnset(); - - /** - * Store the annotation's state in the specified map, recursing into nested - * annotations. Once the state is stored, clear it. - * <p> - * This is used to save an annotation's state when it is converted from - * stand-alone to nested (and vice versa). - * During tests, and possibly at other times (albeit - * asynchronously), the annotation's state is cleared out when the new - * annotation is written to the Java source file; since this will trigger - * a Java change event and the annotation will be sync'ed with the, now - * empty, Java source code annotation. - * - * @see #restoreFrom(Map) - */ - // TODO this can probably be removed if we move to "combination" annotation adapters... - void storeOn(Map<String, Object> map); - - /** - * Restore the annotation's state from the specified map, recursing into nested - * annotations. - * - * @see #storeOn(Map) - */ - // TODO this can probably be removed if we move to "combination" annotation adapters... - void restoreFrom(Map<String, Object> map); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AnnotationContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AnnotationContainer.java deleted file mode 100644 index 5b238a6d39..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AnnotationContainer.java +++ /dev/null @@ -1,92 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.jdt.core.dom.CompilationUnit; - -/** - * Common behavior for all annotation "containers". - * This interface is used mainly in - * {@link org.eclipse.jpt.core.internal.resource.java.source.AnnotationContainerTools}. - * <p> - * 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. - * - * @version 2.3 - * @since 2.2 - */ -public interface AnnotationContainer<T extends NestableAnnotation> -{ - /** - * Return the corresponding JDT DOM annotation from the specified - * AST compilation unit. Used as a starting point when traversing the AST. - */ - org.eclipse.jdt.core.dom.Annotation getAstAnnotation(CompilationUnit astRoot); - - /** - * Return the name of the container annotation's element that is used - * to indicate the nested annotations (typically <code>"value"</code>). - * Used when traversing the AST. - */ - String getElementName(); - - /** - * Return the name of the nested annotations held by the container. - * Used when traversing the AST. - */ - String getNestedAnnotationName(); - - /** - * Return the nested annotations held by the container. - */ - Iterable<T> getNestedAnnotations(); - - /** - * Return the number of nested annotations held by the container. - */ - int getNestedAnnotationsSize(); - - /** - * Add a nested annotation to the container - * without firing change notification. - */ - T addNestedAnnotation(); - - /** - * The specified JDT DOM annotation was added to the JDT DOM annotation - * corresponding to the container. Add a corresponding nested annotation - * to the container and notify interested parties. - */ - void syncAddNestedAnnotation(org.eclipse.jdt.core.dom.Annotation astAnnotation); - - /** - * Move the nested annotation at the specified source index in the - * container to the specified target index without firing change notification. - * Return the moved nested annotation. - */ - T moveNestedAnnotation(int targetIndex, int sourceIndex); - - /** - * Remove the nested annotation at the specified index from the - * container without firing change notification. - */ - T removeNestedAnnotation(int index); - - /** - * The JDT DOM annotations starting at the specified index were removed - * from the JDT DOM annotations corresponding to the container. - * Remove the corresponding nested annotations from the - * container and notify interested parties. - */ - void syncRemoveNestedAnnotations(int index); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AnnotationDefinition.java deleted file mode 100644 index b47791852e..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AnnotationDefinition.java +++ /dev/null @@ -1,67 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.jdt.core.IAnnotation; -import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement; - -/** - * Used to build annotations discovered in the Java source code. - * To provide new <code>AnnotationDefinition</code>s, create a new - * {@link org.eclipse.jpt.core.JpaPlatform} - * by implementing {@link org.eclipse.jpt.core.JpaPlatform JpaPlatform} - * and/or extending - * {@link org.eclipse.jpt.core.internal.GenericJpaPlatform GenericJpaPlatform}. - * <p> - * 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 Annotation - * @see org.eclipse.jpt.core.JpaPlatform - * @see org.eclipse.jpt.core.internal.GenericJpaPlatform - * - * @version 3.0 - * @since 2.0 - */ -public interface AnnotationDefinition -{ - /** - * Return the name of the annotation the definition will build in the - * various #build...(...) methods. - */ - String getAnnotationName(); - - /** - * Build and return an annotation for the specified annotated element. - */ - Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement); - - /** - * Build and return an annotation for the specified JDT annotation - * on the specified annotated element. - */ - Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation); - - /** - * Build and return a <em>null</em> annotation for the specified element. - * Only certain annotations are required to have <em>null</em> implementations; - * typically the annotations with reasonably complex default behavior. - * The <em>null</em> annotation is used by the corresponding default context model. - * The <em>null</em> annotation simplifies the context model code, allowing the - * context model to simply set various bits of state (e.g. <code>name</code>) and the - * <em>null</em> annotation will create a new <em>real</em> annotation and forward the - * new state to it. This reduces the number of <code>null</code> checks in the context - * model (hopefully). - */ - Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverrideAnnotation.java deleted file mode 100644 index b4de2adaa5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverrideAnnotation.java +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import java.util.ListIterator; - -/** - * Corresponds to the JPA annotation - * javax.persistence.AssociationOverride - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface AssociationOverrideAnnotation - extends OverrideAnnotation -{ - String ANNOTATION_NAME = JPA.ASSOCIATION_OVERRIDE; - - - /** - * Corresponds to the 'joinColumns' element of the AssociationOverride annotation. - * Return an empty iterator if the element does not exist in Java. - */ - ListIterator<JoinColumnAnnotation> joinColumns(); - String JOIN_COLUMNS_LIST = "joinColumns"; //$NON-NLS-1$ - - /** - * Corresponds to the 'joinColumns' element of the AssociationOverride annotation. - */ - int joinColumnsSize(); - - /** - * Corresponds to the 'joinColumns' element of the AssociationOverride annotation. - */ - JoinColumnAnnotation joinColumnAt(int index); - - /** - * Corresponds to the 'joinColumns' element of the AssociationOverride annotation. - */ - int indexOfJoinColumn(JoinColumnAnnotation joinColumn); - - /** - * Corresponds to the 'joinColumns' element of the AssociationOverride annotation. - */ - JoinColumnAnnotation addJoinColumn(int index); - - /** - * Corresponds to the 'joinColumns' element of the AssociationOverride annotation. - */ - void moveJoinColumn(int targetIndex, int sourceIndex); - - /** - * Corresponds to the 'joinColumns' element of the AssociationOverride annotation. - */ - void removeJoinColumn(int index); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverridesAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverridesAnnotation.java deleted file mode 100644 index ecdfe84760..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AssociationOverridesAnnotation.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * javax.persistence.AssociationOverrides - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface AssociationOverridesAnnotation - extends ContainerAnnotation<NestableAssociationOverrideAnnotation> -{ - String ANNOTATION_NAME = JPA.ASSOCIATION_OVERRIDES; - - String ASSOCIATION_OVERRIDES_LIST = "associationOverides"; //$NON-NLS-1$ -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverrideAnnotation.java deleted file mode 100644 index 85dbcb2e96..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverrideAnnotation.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * javax.persistence.AttributeOverride - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface AttributeOverrideAnnotation - extends OverrideAnnotation -{ - String ANNOTATION_NAME = JPA.ATTRIBUTE_OVERRIDE; - - - /** - * Corresponds to the 'column' element of the AttributeOverride annotation. - * Return null if the element does not exist in Java. - */ - ColumnAnnotation getColumn(); - String COLUMN_PROPERTY = "column"; //$NON-NLS-1$ - - ColumnAnnotation getNonNullColumn(); - - /** - * Add the 'column' element to the AttributeOverride annotation. - */ - ColumnAnnotation addColumn(); - - /** - * Remove the 'column' element from the AttributeOverride annotation. - */ - void removeColumn(); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverridesAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverridesAnnotation.java deleted file mode 100644 index 526208e885..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/AttributeOverridesAnnotation.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * javax.persistence.AttributeOverrides - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface AttributeOverridesAnnotation - extends ContainerAnnotation<NestableAttributeOverrideAnnotation> -{ - String ANNOTATION_NAME = JPA.ATTRIBUTE_OVERRIDES; - - String ATTRIBUTE_OVERRIDES_LIST = "attributeOverrides"; //$NON-NLS-1$ -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseColumnAnnotation.java deleted file mode 100644 index 0f06453633..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseColumnAnnotation.java +++ /dev/null @@ -1,149 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.utility.TextRange; - -/** - * Corresponds to the JPA annotations:<ul> - * <li><code>javax.persistence.Column<code> - * <li><code>javax.persistence.MapKeyColumn<code> - * <li><code>javax.persistence.JoinColumn<code> - * <li><code>javax.persistence.MapKeyJoinColumn<code> - * </ul> - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface BaseColumnAnnotation - extends NamedColumnAnnotation -{ - // ********** unique ********** - - /** - * Corresponds to the 'unique' element of the *Column annotation. - * Return null if the element does not exist in Java. - */ - Boolean getUnique(); - String UNIQUE_PROPERTY = "unique"; //$NON-NLS-1$ - - /** - * Corresponds to the 'unique' element of the *Column annotation. - * Set to null to remove the element. - */ - void setUnique(Boolean unique); - - /** - * Return the {@link TextRange} for the 'unique' element. If the element - * does not exist return the {@link TextRange} for the *Column annotation. - */ - TextRange getUniqueTextRange(CompilationUnit astRoot); - - - // ********** nullable ********** - - /** - * Corresponds to the 'nullable' element of the *Column annotation. - * Return null if the element does not exist in Java. - */ - Boolean getNullable(); - String NULLABLE_PROPERTY = "nullable"; //$NON-NLS-1$ - - /** - * Corresponds to the 'nullable' element of the *Column annotation. - * Set to null to remove the element. - */ - void setNullable(Boolean nullable); - - /** - * Return the {@link TextRange} for the 'nullable' element. If the element - * does not exist return the {@link TextRange} for the *Column annotation. - */ - TextRange getNullableTextRange(CompilationUnit astRoot); - - - // ********** insertable ********** - - /** - * Corresponds to the 'insertable' element of the *Column annotation. - * Return null if the element does not exist in Java. - */ - Boolean getInsertable(); - String INSERTABLE_PROPERTY = "insertable"; //$NON-NLS-1$ - - /** - * Corresponds to the 'insertable' element of the *Column annotation. - * Set to null to remove the element. - */ - void setInsertable(Boolean insertable); - - /** - * Return the {@link TextRange} for the 'insertable' element. If the element - * does not exist return the {@link TextRange} for the *Column annotation. - */ - TextRange getInsertableTextRange(CompilationUnit astRoot); - - - // ********** updatable ********** - - /** - * Corresponds to the 'updatable' element of the *Column annotation. - * Return null if the element does not exist in Java. - */ - Boolean getUpdatable(); - String UPDATABLE_PROPERTY = "updatable"; //$NON-NLS-1$ - - /** - * Corresponds to the 'updatable' element of the *Column annotation. - * Set to null to remove the element. - */ - void setUpdatable(Boolean updatable); - - /** - * Return the {@link TextRange} for the 'updatable' element. If the element - * does not exist return the {@link TextRange} for the *Column annotation. - */ - TextRange getUpdatableTextRange(CompilationUnit astRoot); - - - // ********** table ********** - - /** - * Corresponds to the 'table' element of the *Column annotation. - * Return null if the element does not exist in Java. - */ - String getTable(); - String TABLE_PROPERTY = "table"; //$NON-NLS-1$ - - /** - * Corresponds to the 'table' element of the *Column annotation. - * Set to null to remove the element. - */ - void setTable(String table); - - /** - * Return the {@link TextRange} for the 'table' element. If the element - * does not exist return the {@link TextRange} for the *Column annotation. - */ - TextRange getTableTextRange(CompilationUnit astRoot); - - /** - * Return whether the specified position touches the 'table' element. - * Return false if the element does not exist. - */ - boolean tableTouches(int pos, CompilationUnit astRoot); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseJoinColumnAnnotation.java deleted file mode 100644 index ad3195f0fb..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseJoinColumnAnnotation.java +++ /dev/null @@ -1,59 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.utility.TextRange; - -/** - * Corresponds to the JPA annotations:<ul> - * <li><code>javax.persistence.JoinColumn<code> - * <li><code>javax.persistence.MapKeyJoinColumn<code> - * </ul> - * 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. - * - * @version 2.3 - * @since 2.3 - */ -public interface BaseJoinColumnAnnotation - extends BaseColumnAnnotation -{ - // ********** referenced column name ********** - - /** - * Corresponds to the 'referencedColumnName' element of the JoinColumn annotation. - * Return null if the element does not exist in Java. - */ - String getReferencedColumnName(); - String REFERENCED_COLUMN_NAME_PROPERTY = "referencedColumnName"; //$NON-NLS-1$ - - /** - * Corresponds to the 'referencedColumnName' element of the JoinColumn annotation. - * Set to null to remove the element. - */ - void setReferencedColumnName(String referencedColumnName); - - /** - * Return the {@link TextRange} for the 'referencedColumnName' element. If element - * does not exist return the {@link TextRange} for the JoinColumn annotation. - */ - TextRange getReferencedColumnNameTextRange(CompilationUnit astRoot); - - /** - * Return whether the specified position touches the 'referencedColumnName' element. - * Return false if the element does not exist. - */ - boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseTableAnnotation.java deleted file mode 100644 index e96224080d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BaseTableAnnotation.java +++ /dev/null @@ -1,165 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import java.util.ListIterator; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.utility.TextRange; - -/** - * Corresponds to the JPA annotations:<ul> - * <li><code>javax.persistence.Table<code> - * <li><code>javax.persistence.JoinTable<code> - * <li><code>javax.persistence.SecondaryTable<code> - * <li><code>javax.persistence.CollectionTable<code> - * </ul> - * 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. - * - * @version 2.3 - * @since 2.2 - */ -public interface BaseTableAnnotation - extends Annotation -{ - /** - * Return whether the annotation exists in Java. - */ - boolean isSpecified(); - - - // ********** name ********** - - /** - * Corresponds to the 'name' element of the *Table annotation. - * Return null if the element does not exist in Java. - */ - String getName(); - String NAME_PROPERTY = "name"; //$NON-NLS-1$ - - /** - * Corresponds to the 'name' element of the *Table annotation. - * Set to null to remove the element. - */ - void setName(String name); - - /** - * Return the {@link TextRange} for the 'name' element. If the element - * does not exist return the {@link TextRange} for the *Table annotation. - */ - TextRange getNameTextRange(CompilationUnit astRoot); - - /** - * Return whether the specified position touches the 'name' element. - * Return false if the element does not exist. - */ - boolean nameTouches(int pos, CompilationUnit astRoot); - - - // ********** schema ********** - - /** - * Corresponds to the 'schema' element of the *Table annotation. - * Return null if the element does not exist in Java. - */ - String getSchema(); - String SCHEMA_PROPERTY = "schema"; //$NON-NLS-1$ - - /** - * Corresponds to the 'schema' element of the *Table annotation. - * Set to null to remove the element. - */ - void setSchema(String schema); - - /** - * Return the {@link TextRange} for the 'schema' element. If the element - * does not exist return the {@link TextRange} for the *Table annotation. - */ - TextRange getSchemaTextRange(CompilationUnit astRoot); - - /** - * Return whether the specified position touches the 'schema' element. - * Return false if the element does not exist. - */ - boolean schemaTouches(int pos, CompilationUnit astRoot); - - - // ********** catalog ********** - - /** - * Corresponds to the 'catalog' element of the *Table annotation. - * Return null if the element does not exist in Java. - */ - String getCatalog(); - String CATALOG_PROPERTY = "catalog"; //$NON-NLS-1$ - - /** - * Corresponds to the 'catalog' element of the *Table annotation. - * Set to null to remove the element. - */ - void setCatalog(String catalog); - - /** - * Return the {@link TextRange} for the 'catalog' element. If the element - * does not exist return the {@link TextRange} for the *Table annotation. - */ - TextRange getCatalogTextRange(CompilationUnit astRoot); - - /** - * Return whether the specified position touches the 'catalog' element. - * Return false if the element does not exist. - */ - boolean catalogTouches(int pos, CompilationUnit astRoot); - - - // ********** unique constraints ********** - - /** - * Corresponds to the 'uniqueConstraints' element of the *Table annotation. - * Return an empty iterator if the element does not exist in Java. - */ - ListIterator<UniqueConstraintAnnotation> uniqueConstraints(); - String UNIQUE_CONSTRAINTS_LIST = "uniqueConstraints"; //$NON-NLS-1$ - - /** - * Corresponds to the 'uniqueConstraints' element of the *Table annotation. - */ - int uniqueConstraintsSize(); - - /** - * Corresponds to the 'uniqueConstraints' element of the *Table annotation. - */ - UniqueConstraintAnnotation uniqueConstraintAt(int index); - - /** - * Corresponds to the 'uniqueConstraints' element of the *Table annotation. - */ - int indexOfUniqueConstraint(UniqueConstraintAnnotation uniqueConstraint); - - /** - * Corresponds to the 'uniqueConstraints' element of the *Table annotation. - */ - UniqueConstraintAnnotation addUniqueConstraint(int index); - - /** - * Corresponds to the 'uniqueConstraints' element of the *Table annotation. - */ - void moveUniqueConstraint(int targetIndex, int sourceIndex); - - /** - * Corresponds to the 'uniqueConstraints' element of the *Table annotation. - */ - void removeUniqueConstraint(int index); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BasicAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BasicAnnotation.java deleted file mode 100644 index 780b49691d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/BasicAnnotation.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.utility.TextRange; - -/** - * Corresponds to the JPA annotation - * javax.persistence.Basic - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface BasicAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JPA.BASIC; - - /** - * Corresponds to the 'fetch' element of the Basic annotation. - * Return null if the element does not exist in Java. - */ - FetchType getFetch(); - String FETCH_PROPERTY = "fetch"; //$NON-NLS-1$ - - /** - * Corresponds to the 'fetch' element of the Basic annotation. - * Set to null to remove the element. - */ - void setFetch(FetchType fetch); - - /** - * Return the {@link TextRange} for the 'fetch' element. If the element - * does not exist return the {@link TextRange} for the Basic annotation. - */ - TextRange getFetchTextRange(CompilationUnit astRoot); - - - /** - * Corresponds to the 'optional' element of the Basic annotation. - * Return null if the element does not exist in Java. - */ - Boolean getOptional(); - String OPTIONAL_PROPERTY = "optional"; //$NON-NLS-1$ - - /** - * Corresponds to the 'optional' element of the Basic annotation. - * Set to null to remove the element. - */ - void setOptional(Boolean optional); - - /** - * Return the {@link TextRange} for the 'optional' element. If the element - * does not exist return the {@link TextRange} for the Basic annotation. - */ - TextRange getOptionalTextRange(CompilationUnit astRoot); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/CascadeType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/CascadeType.java deleted file mode 100644 index 4d08db2b38..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/CascadeType.java +++ /dev/null @@ -1,106 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.jpt.core.jpa2.resource.java.JPA2_0; -import org.eclipse.jpt.utility.internal.ArrayTools; -import org.eclipse.jpt.utility.internal.StringTools; - -/** - * Corresponds to the JPA 1.0/2.0 enum - * javax.persistence.CascadeType - * - * 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. - * - * @version 2.3 - * @since 2.0 - */ -public enum CascadeType { - - ALL(JPA.CASCADE_TYPE__ALL), - PERSIST(JPA.CASCADE_TYPE__PERSIST), - MERGE(JPA.CASCADE_TYPE__MERGE), - REMOVE(JPA.CASCADE_TYPE__REMOVE), - REFRESH(JPA.CASCADE_TYPE__REFRESH), - DETACH(JPA2_0.CASCADE_TYPE__DETACH); //added in JPA 2.0 - - - private String javaAnnotationValue; - - CascadeType(String javaAnnotationValue) { - if (javaAnnotationValue == null) { - throw new NullPointerException(); - } - this.javaAnnotationValue = javaAnnotationValue; - } - - public String getJavaAnnotationValue() { - return this.javaAnnotationValue; - } - - - // ********** static methods ********** - - public static CascadeType[] fromJavaAnnotationValues(Object[] javaAnnotationValues) { - if (javaAnnotationValues == null) { - return EMPTY_CASCADE_TYPE_ARRAY; - } - if (javaAnnotationValues.length == 0) { - return EMPTY_CASCADE_TYPE_ARRAY; - } - //nulls will exist if there is a typo in one of the enums - javaAnnotationValues = ArrayTools.removeAllOccurrences(javaAnnotationValues, null); - int len = javaAnnotationValues.length; - CascadeType[] cascadeTypes = new CascadeType[len]; - for (int i = 0; i < len; i++) { - cascadeTypes[i] = fromJavaAnnotationValue(javaAnnotationValues[i]); - } - return cascadeTypes; - } - private static final CascadeType[] EMPTY_CASCADE_TYPE_ARRAY = new CascadeType[0]; - - public static CascadeType fromJavaAnnotationValue(Object javaAnnotationValue) { - return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue); - } - - private static CascadeType fromJavaAnnotationValue_(Object javaAnnotationValue) { - for (CascadeType cascadeType : CascadeType.values()) { - if (cascadeType.getJavaAnnotationValue().equals(javaAnnotationValue)) { - return cascadeType; - } - } - return null; - } - - public static String[] toJavaAnnotationValues(CascadeType[] cascadeTypes) { - if (cascadeTypes == null) { - return StringTools.EMPTY_STRING_ARRAY; - } - int len = cascadeTypes.length; - if (len == 0) { - return StringTools.EMPTY_STRING_ARRAY; - } - - String[] javaAnnotationValues = new String[len]; - for (int i = 0; i < len; i++) { - javaAnnotationValues[i] = toJavaAnnotationValue(cascadeTypes[i]); - } - return javaAnnotationValues; - } - - public static String toJavaAnnotationValue(CascadeType cascadeType) { - return (cascadeType == null) ? null : cascadeType.getJavaAnnotationValue(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ColumnAnnotation.java deleted file mode 100644 index 5114751c07..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ColumnAnnotation.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * <code>javax.persistence.Column</code> - * <p> - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface ColumnAnnotation - extends CompleteColumnAnnotation -{ - String ANNOTATION_NAME = JPA.COLUMN; -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/CompleteColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/CompleteColumnAnnotation.java deleted file mode 100644 index a112728eee..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/CompleteColumnAnnotation.java +++ /dev/null @@ -1,97 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.utility.TextRange; - -/** - * Corresponds to the JPA annotations:<ul> - * <li><code>javax.persistence.Column<code> - * <li><code>javax.persistence.MapKeyColumn<code> - * </ul> - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface CompleteColumnAnnotation - extends BaseColumnAnnotation -{ - // ********** length ********** - - /** - * Corresponds to the 'length' element of the Column annotation. - * Return null if the element does not exist in Java. - */ - Integer getLength(); - String LENGTH_PROPERTY = "length"; //$NON-NLS-1$ - - /** - * Corresponds to the 'length' element of the Column annotation. - * Set to null to remove the element. - */ - void setLength(Integer length); - - /** - * Return the {@link TextRange} for the 'length' element. If element - * does not exist return the {@link TextRange} for the Column annotation. - */ - TextRange getLengthTextRange(CompilationUnit astRoot); - - - // ********** precision ********** - - /** - * Corresponds to the 'precision' element of the Column annotation. - * Return null if the element does not exist in Java. - */ - Integer getPrecision(); - String PRECISION_PROPERTY = "precision"; //$NON-NLS-1$ - - /** - * Corresponds to the 'precision' element of the Column annotation. - * Set to null to remove the element. - */ - void setPrecision(Integer precision); - - /** - * Return the {@link TextRange} for the 'precision' element. If element - * does not exist return the {@link TextRange} for the Column annotation. - */ - TextRange getPrecisionTextRange(CompilationUnit astRoot); - - - // ********** scale ********** - - /** - * Corresponds to the 'scale' element of the Column annotation. - * Return null if the element does not exist in Java. - */ - Integer getScale(); - String SCALE_PROPERTY = "scale"; //$NON-NLS-1$ - - /** - * Corresponds to the 'scale' element of the Column annotation. - * Set to null to remove the element. - */ - void setScale(Integer scale); - - /** - * Return the {@link TextRange} for the 'scale' element. If element - * does not exist return the {@link TextRange} for the Column annotation. - */ - TextRange getScaleTextRange(CompilationUnit astRoot); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ContainerAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ContainerAnnotation.java deleted file mode 100644 index f1433f9050..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ContainerAnnotation.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Common behavior for all "container" annotations. - * <p> - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface ContainerAnnotation<T extends NestableAnnotation> - extends Annotation, AnnotationContainer<T> -{ - /** - * Convert the specified stand-alone annotation to an annotation nested - * within the container without firing change notification. - */ - void nestStandAloneAnnotation(NestableAnnotation standAloneAnnotation); - - /** - * In preparation for a just-nested annotation being written to the source - * file, add the just-nested annotation to the container annotation at the - * specified index without firing change notification. - * - * @see #nestStandAloneAnnotation(NestableAnnotation) - */ - void addNestedAnnotation(int index, NestableAnnotation annotation); - - /** - * Convert the container's last nested annotation to a stand-alone - * annotation without firing change notification. - */ - void convertLastNestedAnnotationToStandAlone(); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorColumnAnnotation.java deleted file mode 100644 index 3710f79df7..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorColumnAnnotation.java +++ /dev/null @@ -1,62 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * <code>javax.persistence.DiscriminatorColumn</code> - * <p> - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface DiscriminatorColumnAnnotation - extends NamedColumnAnnotation -{ - String ANNOTATION_NAME = JPA.DISCRIMINATOR_COLUMN; - - - // ********** discriminator type ********** - - /** - * Corresponds to the 'discriminatorType' element of the DiscriminatorColumn annotation. - * Return null if the element does not exist in Java. - */ - DiscriminatorType getDiscriminatorType(); - String DISCRIMINATOR_TYPE_PROPERTY = "discriminatorType"; //$NON-NLS-1$ - - /** - * Corresponds to the 'discriminatorType' element of the DiscriminatorColumn annotation. - * Set the to null to remove the element. - */ - void setDiscriminatorType(DiscriminatorType discriminatorType); - - - // ********** length ********** - - /** - * Corresponds to the 'length' element of the DiscriminatorColumn annotation. - * Return null if the element does not exist in Java. - */ - Integer getLength(); - String LENGTH_PROPERTY = "length"; //$NON-NLS-1$ - - /** - * Corresponds to the 'length' element of the DiscriminatorColumn annotation. - * Set the to null to remove the element. - */ - void setLength(Integer length); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorType.java deleted file mode 100644 index 379ad27a49..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorType.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA enum - * javax.persistence.DiscriminatorType - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public enum DiscriminatorType { - - STRING(JPA.DISCRIMINATOR_TYPE__STRING), - CHAR(JPA.DISCRIMINATOR_TYPE__CHAR), - INTEGER(JPA.DISCRIMINATOR_TYPE__INTEGER); - - - private String javaAnnotationValue; - - DiscriminatorType(String javaAnnotationValue) { - if (javaAnnotationValue == null) { - throw new NullPointerException(); - } - this.javaAnnotationValue = javaAnnotationValue; - } - - public String getJavaAnnotationValue() { - return this.javaAnnotationValue; - } - - - // ********** static methods ********** - - public static DiscriminatorType fromJavaAnnotationValue(Object javaAnnotationValue) { - return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue); - } - - private static DiscriminatorType fromJavaAnnotationValue_(Object javaAnnotationValue) { - for (DiscriminatorType discriminatorType : DiscriminatorType.values()) { - if (discriminatorType.getJavaAnnotationValue().equals(javaAnnotationValue)) { - return discriminatorType; - } - } - return null; - } - - public static String toJavaAnnotationValue(DiscriminatorType discriminatorType) { - return (discriminatorType == null) ? null : discriminatorType.getJavaAnnotationValue(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorValueAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorValueAnnotation.java deleted file mode 100644 index fa9e17fda1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/DiscriminatorValueAnnotation.java +++ /dev/null @@ -1,51 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.utility.TextRange; - -/** - * Corresponds to the JPA annotation - * javax.persistence.DiscriminatorValue - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface DiscriminatorValueAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JPA.DISCRIMINATOR_VALUE; - - /** - * Corresponds to the 'value' element of the DiscriminatorValue annotation. - * Return null if the element does not exist in the annotation. - */ - String getValue(); - String VALUE_PROPERTY = "value"; //$NON-NLS-1$ - - /** - * Corresponds to the 'value' element of the DiscriminatorValue annotation. - */ - void setValue(String value); - - /** - * Return the {@link TextRange} for the 'value' element. If the element - * does not exist return the {@link TextRange} for the DiscriminatorValue annotation. - */ - TextRange getValueTextRange(CompilationUnit astRoot); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddableAnnotation.java deleted file mode 100644 index 6b36ce5e83..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddableAnnotation.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * javax.persistence.Embeddable - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface EmbeddableAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JPA.EMBEDDABLE; -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddedAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddedAnnotation.java deleted file mode 100644 index 09d32adfa6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddedAnnotation.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * javax.persistence.Embedded - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface EmbeddedAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JPA.EMBEDDED; -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddedIdAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddedIdAnnotation.java deleted file mode 100644 index 2530c9e452..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EmbeddedIdAnnotation.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * javax.persistence.EmbeddedId - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface EmbeddedIdAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JPA.EMBEDDED_ID; -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EntityAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EntityAnnotation.java deleted file mode 100644 index 44e0351f1b..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EntityAnnotation.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.utility.TextRange; - -/** - * Corresponds to the JPA annotation - * javax.persistence.Entity - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface EntityAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JPA.ENTITY; - - /** - * Corresponds to the 'name' element of the Entity annotation. - * Return null if the element does not exist in Java. - */ - String getName(); - String NAME_PROPERTY = "name"; //$NON-NLS-1$ - - /** - * Corresponds to the 'name' element of the Entity annotation. - * Set to null to remove the element. - */ - void setName(String name); - - /** - * Return the {@link TextRange} for the 'name' element. If the element - * does not exist return the {@link TextRange} for the Entity annotation. - */ - TextRange getNameTextRange(CompilationUnit astRoot); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EnumType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EnumType.java deleted file mode 100644 index 5220dd3317..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EnumType.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA enum - * javax.persistence.EnumType - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public enum EnumType { - - ORDINAL(JPA.ENUM_TYPE__ORDINAL), - STRING(JPA.ENUM_TYPE__STRING); - - - private String javaAnnotationValue; - - EnumType(String javaAnnotationValue) { - if (javaAnnotationValue == null) { - throw new NullPointerException(); - } - this.javaAnnotationValue = javaAnnotationValue; - } - - public String getJavaAnnotationValue() { - return this.javaAnnotationValue; - } - - - // ********** static methods ********** - - public static EnumType fromJavaAnnotationValue(Object javaAnnotationValue) { - return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue); - } - - private static EnumType fromJavaAnnotationValue_(Object javaAnnotationValue) { - for (EnumType enumType : EnumType.values()) { - if (enumType.getJavaAnnotationValue().equals(javaAnnotationValue)) { - return enumType; - } - } - return null; - } - - public static String toJavaAnnotationValue(EnumType enumType) { - return (enumType == null) ? null : enumType.getJavaAnnotationValue(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EnumeratedAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EnumeratedAnnotation.java deleted file mode 100644 index bc0cd26e33..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/EnumeratedAnnotation.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.utility.TextRange; - -/** - * Corresponds to the JPA annotation - * javax.persistence.Enumerated - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface EnumeratedAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JPA.ENUMERATED; - - /** - * Corresponds to the 'value' element of the Enumerated annotation. - * Return null if the element does not exist in Java. - */ - EnumType getValue(); - String VALUE_PROPERTY = "value"; //$NON-NLS-1$ - - /** - * Corresponds to the 'value' element of the Enumerated annotation. - * Set to null to remove the element. - */ - void setValue(EnumType value); - - /** - * Return the {@link TextRange} for the 'value' element. If the element - * does not exist return the {@link TextRange} for the Enumerated annotation. - */ - TextRange getValueTextRange(CompilationUnit astRoot); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/FetchType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/FetchType.java deleted file mode 100644 index c9bc5cb6c8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/FetchType.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA enum - * javax.persistence.FetchType - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public enum FetchType { - - EAGER(JPA.FETCH_TYPE__EAGER), - LAZY(JPA.FETCH_TYPE__LAZY); - - - private String javaAnnotationValue; - - FetchType(String javaAnnotationValue) { - if (javaAnnotationValue == null) { - throw new NullPointerException(); - } - this.javaAnnotationValue = javaAnnotationValue; - } - - public String getJavaAnnotationValue() { - return this.javaAnnotationValue; - } - - - // ********** static methods ********** - - public static FetchType fromJavaAnnotationValue(Object javaAnnotationValue) { - return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue); - } - - private static FetchType fromJavaAnnotationValue_(Object javaAnnotationValue) { - for (FetchType fetchType : FetchType.values()) { - if (fetchType.getJavaAnnotationValue().equals(javaAnnotationValue)) { - return fetchType; - } - } - return null; - } - - public static String toJavaAnnotationValue(FetchType fetchType) { - return (fetchType == null) ? null : fetchType.getJavaAnnotationValue(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GeneratedValueAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GeneratedValueAnnotation.java deleted file mode 100644 index e2583eb73d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GeneratedValueAnnotation.java +++ /dev/null @@ -1,78 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.utility.TextRange; - -/** - * Corresponds to the JPA annotation - * javax.persistence.GeneratedValue - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface GeneratedValueAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JPA.GENERATED_VALUE; - - /** - * Corresponds to the 'strategy' element of the GeneratedValue annotation. - * Return null if the element does not exist in Java. - */ - GenerationType getStrategy(); - String STRATEGY_PROPERTY = "strategy"; //$NON-NLS-1$ - - /** - * Corresponds to the 'strategy' element of the GeneratedValue annotation. - * Set to null to remove the element. - */ - void setStrategy(GenerationType strategy); - - /** - * Return the {@link TextRange} for the 'strategy' element. If the element - * does not exist return the {@link TextRange} for the GeneratedValue annotation. - */ - TextRange getStrategyTextRange(CompilationUnit astRoot); - - - /** - * Corresponds to the 'generator' element of the GeneratedValue annotation. - * Return null if the element does not exist in Java. - */ - String getGenerator(); - String GENERATOR_PROPERTY = "generator"; //$NON-NLS-1$ - - /** - * Corresponds to the 'generator' element of the GeneratedValue annotation. - * Set to null to remove the element. - */ - void setGenerator(String generator); - - /** - * Return the {@link TextRange} for the 'generator' element. If the element - * does not exist return the {@link TextRange} for the GeneratedValue annotation. - */ - TextRange getGeneratorTextRange(CompilationUnit astRoot); - - /** - * Return whether the specified position touches the 'generator' element. - * Return false if the element does not exist. - */ - boolean generatorTouches(int pos, CompilationUnit astRoot); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GenerationType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GenerationType.java deleted file mode 100644 index 8977b6f7fa..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GenerationType.java +++ /dev/null @@ -1,66 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA enum - * javax.persistence.GenerationType - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public enum GenerationType { - - TABLE(JPA.GENERATION_TYPE__TABLE), - SEQUENCE(JPA.GENERATION_TYPE__SEQUENCE), - IDENTITY(JPA.GENERATION_TYPE__IDENTITY), - AUTO(JPA.GENERATION_TYPE__AUTO); - - - private String javaAnnotationValue; - - GenerationType(String javaAnnotationValue) { - if (javaAnnotationValue == null) { - throw new NullPointerException(); - } - this.javaAnnotationValue = javaAnnotationValue; - } - - public String getJavaAnnotationValue() { - return this.javaAnnotationValue; - } - - - // ********** static methods ********** - - public static GenerationType fromJavaAnnotationValue(Object javaAnnotationValue) { - return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue); - } - - private static GenerationType fromJavaAnnotationValue_(Object javaAnnotationValue) { - for (GenerationType generationType : GenerationType.values()) { - if (generationType.getJavaAnnotationValue().equals(javaAnnotationValue)) { - return generationType; - } - } - return null; - } - - public static String toJavaAnnotationValue(GenerationType generationType) { - return (generationType == null) ? null : generationType.getJavaAnnotationValue(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GeneratorAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GeneratorAnnotation.java deleted file mode 100644 index 7ff3b6734f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/GeneratorAnnotation.java +++ /dev/null @@ -1,92 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.utility.TextRange; - -/** - * Common protocol among - * javax.persistence.SequenceGenerator - * javax.persistence.TableGenerator - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface GeneratorAnnotation - extends Annotation -{ - /** - * Corresponds to the 'name' element of the *Generator annotation. - * Return null if the element does not exist in Java. - */ - String getName(); - String NAME_PROPERTY = "name"; //$NON-NLS-1$ - - /** - * Corresponds to the 'name' element of the *Generator annotation. - * Set to null to remove the element. - */ - void setName(String name); - - /** - * Return the {@link TextRange} for the 'name' element. If the element - * does not exist return the {@link TextRange} for the *Generator annotation. - */ - TextRange getNameTextRange(CompilationUnit astRoot); - - - /** - * Corresponds to the 'initialValue' element of the *Generator annotation. - * Return null if the element does not exist in Java. - */ - Integer getInitialValue(); - String INITIAL_VALUE_PROPERTY = "initialValue"; //$NON-NLS-1$ - - /** - * Corresponds to the 'initialValue' element of the *Generator annotation. - * Set to null to remove the element. - */ - void setInitialValue(Integer initialValue); - - /** - * Return the {@link TextRange} for the 'initialValue' element. If the element - * does not exist return the {@link TextRange} for the *Generator annotation. - */ - TextRange getInitialValueTextRange(CompilationUnit astRoot); - - - /** - * Corresponds to the 'allocationSize' element of the *Generator annotation. - * Return null if the element does not exist in Java. - */ - Integer getAllocationSize(); - String ALLOCATION_SIZE_PROPERTY = "allocationSize"; //$NON-NLS-1$ - - /** - * Corresponds to the 'allocationSize' element of the *Generator annotation. - * Set to null to remove the element. - */ - void setAllocationSize(Integer allocationSize); - - /** - * Return the {@link TextRange} for the 'allocationSize' element. If the element - * does not exist return the {@link TextRange} for the *Generator annotation. - */ - TextRange getAllocationSizeTextRange(CompilationUnit astRoot); - - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/IdAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/IdAnnotation.java deleted file mode 100644 index 65ce3fca29..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/IdAnnotation.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * javax.persistence.Id - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface IdAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JPA.ID; -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/IdClassAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/IdClassAnnotation.java deleted file mode 100644 index ac0d15a380..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/IdClassAnnotation.java +++ /dev/null @@ -1,67 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.utility.TextRange; - -/** - * This interface corresponds to the JPA annotation - * javax.persistence.IdClass - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface IdClassAnnotation - extends Annotation -{ - final String ANNOTATION_NAME = JPA.ID_CLASS; - - /** - * Corresponds to the 'value' element of the IdClass annotation. - * Return null if the element does not exist in Java. - * Return the portion of the value preceding ".class". - * <pre> - * @IdClass(value=Employee.class) - * </pre> - * will return "Employee" - */ - String getValue(); - String VALUE_PROPERTY = "value"; //$NON-NLS-1$ - - /** - * Corresponds to the 'value' element of the IdClass annotation. - * Set to null to remove the element. - */ - void setValue(String value); - - /** - * Return the {@link TextRange} for the 'value' element. If the element - * does not exist return the {@link TextRange} for the IdClass annotation. - */ - TextRange getValueTextRange(CompilationUnit astRoot); - - /** - * Return the fully-qualified ID class name as resolved by the - * AST's bindings. - * <pre> - * @IdClass(Employee.class) - * </pre> - * will return <code>"model.Employee"</code> if there is an import for - * <code>model.Employee</code>. - */ - String getFullyQualifiedClassName(); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/InheritanceAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/InheritanceAnnotation.java deleted file mode 100644 index bb93b8efea..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/InheritanceAnnotation.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.utility.TextRange; - -/** - * Corresponds to the JPA annotation - * javax.persistence.Inheritance - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface InheritanceAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JPA.INHERITANCE; - - /** - * Corresponds to the 'strategy' element of the Inheritance annotation. - * Return null if the element does not exist in Java. - */ - InheritanceType getStrategy(); - String STRATEGY_PROPERTY = "strategy"; //$NON-NLS-1$ - - /** - * Corresponds to the 'strategy' element of the Inheritance annotation. - * Set to null to remove the element. - */ - void setStrategy(InheritanceType strategy); - - /** - * Return the {@link TextRange} for the 'strategy' element. If the element - * does not exist return the {@link TextRange} for the Inheritance annotation. - */ - TextRange getStrategyTextRange(CompilationUnit astRoot); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/InheritanceType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/InheritanceType.java deleted file mode 100644 index 5d6b984989..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/InheritanceType.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA enum - * javax.persistence.InheritanceType - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public enum InheritanceType { - - SINGLE_TABLE(JPA.INHERITANCE_TYPE__SINGLE_TABLE), - JOINED(JPA.INHERITANCE_TYPE__JOINED), - TABLE_PER_CLASS(JPA.INHERITANCE_TYPE__TABLE_PER_CLASS); - - - private String javaAnnotationValue; - - InheritanceType(String javaAnnotationValue) { - if (javaAnnotationValue == null) { - throw new NullPointerException(); - } - this.javaAnnotationValue = javaAnnotationValue; - } - - public String getJavaAnnotationValue() { - return this.javaAnnotationValue; - } - - - // ********** static methods ********** - - public static InheritanceType fromJavaAnnotationValue(Object javaAnnotationValue) { - return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue); - } - - private static InheritanceType fromJavaAnnotationValue_(Object javaAnnotationValue) { - for (InheritanceType inheritanceType : InheritanceType.values()) { - if (inheritanceType.getJavaAnnotationValue().equals(javaAnnotationValue)) { - return inheritanceType; - } - } - return null; - } - - public static String toJavaAnnotationValue(InheritanceType inheritanceType) { - return (inheritanceType == null) ? null : inheritanceType.getJavaAnnotationValue(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JPA.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JPA.java deleted file mode 100644 index 39bf5be75a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JPA.java +++ /dev/null @@ -1,303 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * JPA Java-related stuff (annotations etc.) - * <p> - * 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. - * - * @version 2.3 - * @since 2.0 - */ -@SuppressWarnings("nls") -public interface JPA { - - // JPA package - String PACKAGE = "javax.persistence"; - String PACKAGE_ = PACKAGE + '.'; - - - // ********** API ********** - - // JPA annotations - String ASSOCIATION_OVERRIDE = PACKAGE_ + "AssociationOverride"; - String ASSOCIATION_OVERRIDE__NAME = "name"; - String ASSOCIATION_OVERRIDE__JOIN_COLUMNS = "joinColumns"; - String ASSOCIATION_OVERRIDES = PACKAGE_ + "AssociationOverrides"; - String ASSOCIATION_OVERRIDES__VALUE = "value"; - String ATTRIBUTE_OVERRIDE = PACKAGE_ + "AttributeOverride"; - String ATTRIBUTE_OVERRIDE__NAME = "name"; - String ATTRIBUTE_OVERRIDE__COLUMN = "column"; - String ATTRIBUTE_OVERRIDES = PACKAGE_ + "AttributeOverrides"; - String ATTRIBUTE_OVERRIDES__VALUE = "value"; - String BASIC = PACKAGE_ + "Basic"; - String BASIC__FETCH = "fetch"; - String BASIC__OPTIONAL = "optional"; - String COLUMN = PACKAGE_ + "Column"; - String COLUMN__NAME = "name"; - String COLUMN__UNIQUE = "unique"; - String COLUMN__NULLABLE = "nullable"; - String COLUMN__INSERTABLE = "insertable"; - String COLUMN__UPDATABLE = "updatable"; - String COLUMN__COLUMN_DEFINITION = "columnDefinition"; - String COLUMN__TABLE = "table"; - String COLUMN__LENGTH = "length"; - String COLUMN__PRECISION = "precision"; - String COLUMN__SCALE = "scale"; - String COLUMN_RESULT = PACKAGE_ + "ColumnResult"; - String COLUMN_RESULT__NAME = "name"; - String DISCRIMINATOR_COLUMN = PACKAGE_ + "DiscriminatorColumn"; - String DISCRIMINATOR_COLUMN__NAME = "name"; - String DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE = "discriminatorType"; - String DISCRIMINATOR_COLUMN__COLUMN_DEFINITION = "columnDefinition"; - String DISCRIMINATOR_COLUMN__LENGTH = "length"; - String DISCRIMINATOR_VALUE = PACKAGE_ + "DiscriminatorValue"; - String DISCRIMINATOR_VALUE__VALUE = "value"; - String EMBEDDABLE = PACKAGE_ + "Embeddable"; - String EMBEDDED = PACKAGE_ + "Embedded"; - String EMBEDDED_ID = PACKAGE_ + "EmbeddedId"; - String ENTITY = PACKAGE_ + "Entity"; - String ENTITY__NAME = "name"; - String ENTITY_LISTENERS = PACKAGE_ + "EntityListeners"; - String ENTITY_LISTENERS__VALUE = "value"; - String ENTITY_RESULT = PACKAGE_ + "EntityResult"; - String ENTITY_RESULT__ENTITY_CLASS = "entityClass"; - String ENTITY_RESULT__FIELDS = "fields"; - String ENTITY_RESULT__DISCRIMINATOR_COLUMN = "discriminatorColumn"; - String ENUMERATED = PACKAGE_ + "Enumerated"; - String ENUMERATED__VALUE = "value"; - String EXCLUDE_DEFAULT_LISTENERS = PACKAGE_ + "ExcludeDefaultListeners"; - String EXCLUDE_SUPERCLASS_LISTENERS = PACKAGE_ + "ExcludeSuperclassListeners"; - String FIELD_RESULT = PACKAGE_ + "FieldResult"; - String FIELD_RESULT__NAME = "name"; - String FIELD_RESULT__COLUMN = "column"; - String FLUSH_MODE = PACKAGE_ + "FlushMode"; - String FLUSH_MODE__VALUE = "value"; - String GENERATED_VALUE = PACKAGE_ + "GeneratedValue"; - String GENERATED_VALUE__STRATEGY = "strategy"; - String GENERATED_VALUE__GENERATOR = "generator"; - String ID = PACKAGE_ + "Id"; - String ID_CLASS = PACKAGE_ + "IdClass"; - String ID_CLASS__VALUE = "value"; - String INHERITANCE = PACKAGE_ + "Inheritance"; - String INHERITANCE__STRATEGY = "strategy"; - String JOIN_COLUMN = PACKAGE_ + "JoinColumn"; - String JOIN_COLUMN__NAME = "name"; - String JOIN_COLUMN__REFERENCED_COLUMN_NAME = "referencedColumnName"; - String JOIN_COLUMN__UNIQUE = "unique"; - String JOIN_COLUMN__NULLABLE = "nullable"; - String JOIN_COLUMN__INSERTABLE = "insertable"; - String JOIN_COLUMN__UPDATABLE = "updatable"; - String JOIN_COLUMN__COLUMN_DEFINITION = "columnDefinition"; - String JOIN_COLUMN__TABLE = "table"; - String JOIN_COLUMNS = PACKAGE_ + "JoinColumns"; - String JOIN_COLUMNS__VALUE = "value"; - String JOIN_TABLE = PACKAGE_ + "JoinTable"; - String JOIN_TABLE__NAME = "name"; - String JOIN_TABLE__CATALOG = "catalog"; - String JOIN_TABLE__SCHEMA = "schema"; - String JOIN_TABLE__JOIN_COLUMNS = "joinColumns"; - String JOIN_TABLE__INVERSE_JOIN_COLUMNS = "inverseJoinColumns"; - String JOIN_TABLE__UNIQUE_CONSTRAINTS = "uniqueConstraints"; - String LOB = PACKAGE_ + "Lob"; - String MANY_TO_MANY = PACKAGE_ + "ManyToMany"; - String MANY_TO_MANY__TARGET_ENTITY = "targetEntity"; - String MANY_TO_MANY__CASCADE = "cascade"; - String MANY_TO_MANY__FETCH = "fetch"; - String MANY_TO_MANY__MAPPED_BY = "mappedBy"; - String MANY_TO_ONE = PACKAGE_ + "ManyToOne"; - String MANY_TO_ONE__TARGET_ENTITY = "targetEntity"; - String MANY_TO_ONE__CASCADE = "cascade"; - String MANY_TO_ONE__FETCH = "fetch"; - String MANY_TO_ONE__OPTIONAL = "optional"; - String MAP_KEY = PACKAGE_ + "MapKey"; - String MAP_KEY__NAME = "name"; - String MAPPED_SUPERCLASS = PACKAGE_ + "MappedSuperclass"; - String NAMED_NATIVE_QUERIES = PACKAGE_ + "NamedNativeQueries"; - String NAMED_NATIVE_QUERIES__VALUE = "value"; - String NAMED_NATIVE_QUERY = PACKAGE_ + "NamedNativeQuery"; - String NAMED_NATIVE_QUERY__NAME = "name"; - String NAMED_NATIVE_QUERY__QUERY = "query"; - String NAMED_NATIVE_QUERY__HINTS = "hints"; - String NAMED_NATIVE_QUERY__RESULT_CLASS = "resultClass"; - String NAMED_NATIVE_QUERY__RESULT_SET_MAPPING = "resultSetMapping"; - String NAMED_QUERIES = PACKAGE_ + "NamedQueries"; - String NAMED_QUERIES__VALUE = "value"; - String NAMED_QUERY = PACKAGE_ + "NamedQuery"; - String NAMED_QUERY__NAME = "name"; - String NAMED_QUERY__QUERY = "query"; - String NAMED_QUERY__HINTS = "hints"; - String ONE_TO_MANY = PACKAGE_ + "OneToMany"; - String ONE_TO_MANY__TARGET_ENTITY = "targetEntity"; - String ONE_TO_MANY__CASCADE = "cascade"; - String ONE_TO_MANY__FETCH = "fetch"; - String ONE_TO_MANY__MAPPED_BY = "mappedBy"; - String ONE_TO_ONE = PACKAGE_ + "OneToOne"; - String ONE_TO_ONE__TARGET_ENTITY = "targetEntity"; - String ONE_TO_ONE__CASCADE = "cascade"; - String ONE_TO_ONE__FETCH = "fetch"; - String ONE_TO_ONE__OPTIONAL = "optional"; - String ONE_TO_ONE__MAPPED_BY = "mappedBy"; - String ORDER_BY = PACKAGE_ + "OrderBy"; - String ORDER_BY__VALUE = "value"; - String PERSISTENCE_CONTEXT = PACKAGE_ + "PersistenceContext"; - String PERSISTENCE_CONTEXT__NAME = "name"; - String PERSISTENCE_CONTEXT__UNIT_NAME = "unitName"; - String PERSISTENCE_CONTEXT__TYPE = "type"; - String PERSISTENCE_CONTEXTS = PACKAGE_ + "PersistenceContexts"; - String PERSISTENCE_CONTEXTS__VALUE = "value"; - String PERSISTENCE_UNIT = PACKAGE_ + "XmlPersistenceUnit"; - String PERSISTENCE_UNIT__NAME = "name"; - String PERSISTENCE_UNIT__UNIT_NAME = "unitName"; - String PERSISTENCE_UNITS = PACKAGE_ + "PersistenceUnits"; - String PERSISTENCE_UNITS__VALUE = "value"; - String POST_LOAD = PACKAGE_ + "PostLoad"; - String POST_PERSIST = PACKAGE_ + "PostPersist"; - String POST_REMOVE = PACKAGE_ + "PostRemove"; - String POST_UPDATE = PACKAGE_ + "PostUpdate"; - String PRE_PERSIST = PACKAGE_ + "PrePersist"; - String PRE_REMOVE = PACKAGE_ + "PreRemove"; - String PRE_UPDATE = PACKAGE_ + "PreUpdate"; - String PRIMARY_KEY_JOIN_COLUMN = PACKAGE_ + "PrimaryKeyJoinColumn"; - String PRIMARY_KEY_JOIN_COLUMN__NAME = "name"; - String PRIMARY_KEY_JOIN_COLUMN__REFERENCED_COLUMN_NAME = "referencedColumnName"; - String PRIMARY_KEY_JOIN_COLUMN__COLUMN_DEFINITION = "columnDefinition"; - String PRIMARY_KEY_JOIN_COLUMNS = PACKAGE_ + "PrimaryKeyJoinColumns"; - String PRIMARY_KEY_JOIN_COLUMNS__VALUE = "value"; - String QUERY_HINT = PACKAGE_ + "QueryHint"; - String QUERY_HINT__NAME = "name"; - String QUERY_HINT__VALUE = "value"; - String SECONDARY_TABLE = PACKAGE_ + "SecondaryTable"; - String SECONDARY_TABLE__NAME = "name"; - String SECONDARY_TABLE__CATALOG = "catalog"; - String SECONDARY_TABLE__SCHEMA = "schema"; - String SECONDARY_TABLE__PK_JOIN_COLUMNS = "pkJoinColumns"; - String SECONDARY_TABLE__UNIQUE_CONSTRAINTS = "uniqueConstraints"; - String SECONDARY_TABLES = PACKAGE_ + "SecondaryTables"; - String SECONDARY_TABLES__VALUE = "value"; - String SEQUENCE_GENERATOR = PACKAGE_ + "SequenceGenerator"; - String SEQUENCE_GENERATOR__NAME = "name"; - String SEQUENCE_GENERATOR__SEQUENCE_NAME = "sequenceName"; - String SEQUENCE_GENERATOR__INITIAL_VALUE = "initialValue"; - String SEQUENCE_GENERATOR__ALLOCATION_SIZE = "allocationSize"; - String SQL_RESULT_SET_MAPPING = PACKAGE_ + "SqlResultSetMapping"; - String SQL_RESULT_SET_MAPPING__NAME = "name"; - String SQL_RESULT_SET_MAPPING__ENTITIES = "entities"; - String SQL_RESULT_SET_MAPPING__COLUMNS = "columns"; - String TABLE = PACKAGE_ + "Table"; - String TABLE__NAME = "name"; - String TABLE__CATALOG = "catalog"; - String TABLE__SCHEMA = "schema"; - String TABLE__UNIQUE_CONSTRAINTS = "uniqueConstraints"; - String TABLE_GENERATOR = PACKAGE_ + "TableGenerator"; - String TABLE_GENERATOR__NAME = "name"; - String TABLE_GENERATOR__TABLE = "table"; - String TABLE_GENERATOR__CATALOG = "catalog"; - String TABLE_GENERATOR__SCHEMA = "schema"; - String TABLE_GENERATOR__PK_COLUMN_NAME = "pkColumnName"; - String TABLE_GENERATOR__VALUE_COLUMN_NAME = "valueColumnName"; - String TABLE_GENERATOR__PK_COLUMN_VALUE = "pkColumnValue"; - String TABLE_GENERATOR__INITIAL_VALUE = "initialValue"; - String TABLE_GENERATOR__ALLOCATION_SIZE = "allocationSize"; - String TABLE_GENERATOR__UNIQUE_CONSTRAINTS = "uniqueConstraints"; - String TEMPORAL = PACKAGE_ + "Temporal"; - String TEMPORAL__VALUE = "value"; - String TRANSIENT = PACKAGE_ + "Transient"; - String UNIQUE_CONSTRAINT = PACKAGE_ + "UniqueConstraint"; - String UNIQUE_CONSTRAINT__COLUMN_NAMES = "columnNames"; - String VERSION = PACKAGE_ + "Version"; - - // JPA enums - String CASCADE_TYPE = PACKAGE_ + "CascadeType"; - String CASCADE_TYPE_ = CASCADE_TYPE + '.'; - String CASCADE_TYPE__ALL = CASCADE_TYPE_ + "ALL"; - String CASCADE_TYPE__MERGE = CASCADE_TYPE_ + "MERGE"; - String CASCADE_TYPE__PERSIST = CASCADE_TYPE_ + "PERSIST"; - String CASCADE_TYPE__REFRESH = CASCADE_TYPE_ + "REFRESH"; - String CASCADE_TYPE__REMOVE = CASCADE_TYPE_ + "REMOVE"; - - String DISCRIMINATOR_TYPE = PACKAGE_ + "DiscriminatorType"; - String DISCRIMINATOR_TYPE_ = DISCRIMINATOR_TYPE + '.'; - String DISCRIMINATOR_TYPE__CHAR = DISCRIMINATOR_TYPE_ + "CHAR"; - String DISCRIMINATOR_TYPE__INTEGER = DISCRIMINATOR_TYPE_ + "INTEGER"; - String DISCRIMINATOR_TYPE__STRING = DISCRIMINATOR_TYPE_ + "STRING"; - - String ENUM_TYPE = PACKAGE_ + "EnumType"; - String ENUM_TYPE_ = ENUM_TYPE + '.'; - String ENUM_TYPE__ORDINAL = ENUM_TYPE_ + "ORDINAL"; - String ENUM_TYPE__STRING = ENUM_TYPE_ + "STRING"; - - String FETCH_TYPE = PACKAGE_ + "FetchType"; - String FETCH_TYPE_ = FETCH_TYPE + '.'; - String FETCH_TYPE__EAGER = FETCH_TYPE_ + "EAGER"; - String FETCH_TYPE__LAZY = FETCH_TYPE_ + "LAZY"; - - String FLUSH_MODE_TYPE = PACKAGE_ + "FlushModeType"; - String FLUSH_MODE_TYPE_ = FLUSH_MODE_TYPE + '.'; - String FLUSH_MODE_TYPE__AUTO = FLUSH_MODE_TYPE_ + "AUTO"; - String FLUSH_MODE_TYPE__COMMIT = FLUSH_MODE_TYPE_ + "COMMIT"; - - String GENERATION_TYPE = PACKAGE_ + "GenerationType"; - String GENERATION_TYPE_ = GENERATION_TYPE + '.'; - String GENERATION_TYPE__AUTO = GENERATION_TYPE_ + "AUTO"; - String GENERATION_TYPE__IDENTITY = GENERATION_TYPE_ + "IDENTITY"; - String GENERATION_TYPE__SEQUENCE = GENERATION_TYPE_ + "SEQUENCE"; - String GENERATION_TYPE__TABLE = GENERATION_TYPE_ + "TABLE"; - - String INHERITANCE_TYPE = PACKAGE_ + "InheritanceType"; - String INHERITANCE_TYPE_ = INHERITANCE_TYPE + '.'; - String INHERITANCE_TYPE__JOINED = INHERITANCE_TYPE_ + "JOINED"; - String INHERITANCE_TYPE__SINGLE_TABLE = INHERITANCE_TYPE_ + "SINGLE_TABLE"; - String INHERITANCE_TYPE__TABLE_PER_CLASS = INHERITANCE_TYPE_ + "TABLE_PER_CLASS"; - - String PERSISTENCE_CONTEXT_TYPE = PACKAGE_ + "PersistenceContextType"; - String PERSISTENCE_CONTEXT_TYPE_ = PERSISTENCE_CONTEXT_TYPE + '.'; - String PERSISTENCE_CONTEXT_TYPE__EXTENDED = PERSISTENCE_CONTEXT_TYPE_ + "EXTENDED"; - String PERSISTENCE_CONTEXT_TYPE__TRANSACTION = PERSISTENCE_CONTEXT_TYPE_ + "TRANSACTION"; - - String TEMPORAL_TYPE = PACKAGE_ + "TemporalType"; - String TEMPORAL_TYPE_ = TEMPORAL_TYPE + '.'; - String TEMPORAL_TYPE__DATE = TEMPORAL_TYPE_ + "DATE"; - String TEMPORAL_TYPE__TIME = TEMPORAL_TYPE_ + "TIME"; - String TEMPORAL_TYPE__TIMESTAMP = TEMPORAL_TYPE_ + "TIMESTAMP"; - - // JPA interfaces - String ENTITY_MANAGER = PACKAGE_ + "EntityManager"; - String ENTITY_MANAGER_FACTORY = PACKAGE_ + "EntityManagerFactory"; - String ENTITY_TRANSACTION = PACKAGE_ + "EntityTransaction"; - String INSTRUMENTABLE_CLASS_LOADER = PACKAGE_ + "InstrumentableClassLoader"; - String QUERY = PACKAGE_ + "Query"; - - // JPA classes - String PERSISTENCE = PACKAGE_ + "XmlPersistence"; - - // JPA exceptions - String NON_UNIQUE_RESULT_EXCEPTION = PACKAGE_ + "NonUniqueResultException"; - String OBJECT_NOT_FOUND_EXCEPTION = PACKAGE_ + "ObjectNotFoundException"; - String PERSISTENCE_EXCEPTION = PACKAGE_ + "PersistenceException"; - - - // ********** SPI ********** - - // JPA SPI package - String SPI_PACKAGE = PACKAGE_ + "spi"; - String SPI_PACKAGE_ = SPI_PACKAGE + '.'; - - // JPA SPI interfaces - String ENTITY_MANAGER_FACTORY_PROVIDER = SPI_PACKAGE_ + "EntityManagerFactoryProvider"; - String PERSISTENCE_INFO = SPI_PACKAGE_ + "PersistenceInfo"; - String PERSISTENCE_PROVIDER = SPI_PACKAGE_ + "PersistenceProvider"; - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceAnnotatedElement.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceAnnotatedElement.java deleted file mode 100644 index 548f9036c7..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceAnnotatedElement.java +++ /dev/null @@ -1,137 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import java.util.Iterator; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.utility.TextRange; - -/** - * Java source code or binary annotated element. - * <p> - * 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. - * - * @version 3.0 - * @since 3.0 - */ -public interface JavaResourceAnnotatedElement - extends JavaResourceNode -{ - // ********** annotations ********** - - /** - * String associated with changes to the "annotations" collection - */ - String ANNOTATIONS_COLLECTION = "annotations"; //$NON-NLS-1$ - - /** - * Return the member's annotations in the order they appear. - * Do not return duplicate annotations as this error is handled by the Java - * compiler. - */ - Iterator<Annotation> annotations(); - - /** - * Return the number of annotations. - */ - int annotationsSize(); - - /** - * Return the annotation with the specified name. - * Return the first if there are duplicates in the source code. - * Return <code>null</code> if the member does not have an annotation - * with the specified name. - */ - Annotation getAnnotation(String annotationName); - - /** - * Return the annotation with the specified name. - * Return the first if there are duplicates in the source code. - * Do not return <code>null</code>; instead, return but a <em>null</em> - * annotation (i.e. an implementation that provides only default behavior) - * if the member does not have an annotation with the specified name. - */ - Annotation getNonNullAnnotation(String annotationName); - - /** - * Return the nestable annotations with the specified name in the order - * they appear. - * If nestable and container annotations are both specified on the - * member directly, return only the nestable annotations specified within - * the container annotation. - */ - // TODO tie the singular and plural annotations together so we can generate - // a validation error when both are specified - Iterator<NestableAnnotation> annotations(String nestableAnnotationName, String containerAnnotationName); - - /** - * Add an annotation with the specified name. - * Return the newly-created annotation. - */ - Annotation addAnnotation(String annotationName); - - /** - * Add a new nestable annotation with the specified name. - * Create a new container annotation if necessary and add the nestable - * annotation to it. - * If both the nestable annotation and the container annotation already - * exist, then add to the container annotation, leaving the existing - * nestable annotation alone. - * If only the nestable annotation exists, then create the new container - * annotation and move the existing nestable annotation to it along with - * the new one. If neither annotation exists, then create a new nestable - * annotation. - */ - NestableAnnotation addAnnotation(int index, String nestableAnnotationName, String containerAnnotationName); - - /** - * Move the nestable annotation found in the specified container - * annotation at the specified source index to the specified target index. - */ - void moveAnnotation(int targetIndex, int sourceIndex, String containerAnnotationName); - - /** - * Remove the specified annotation. - */ - void removeAnnotation(String annotationName); - - /** - * Remove the specified nestable annotation from the container annotation at the specified - * index. - * If there is no container, assume the index is zero and this does the same as - * {@link #removeAnnotation(String)} - */ - void removeAnnotation(int index, String nestableAnnotationName, String containerAnnotationName); - - /** - * In preparation for a just-unnested annotation being written to the source - * file, add the just-unnested annotation to the member without firing - * change notification. - */ - void addStandAloneAnnotation(NestableAnnotation standAloneAnnotation); - - - // ********** queries ********** - - /** - * Return whether the underlying JDT member is currently annotated with any recognized - * annotations. - */ - boolean isAnnotated(); - - /** - * Return the text range for the member's name. - */ - TextRange getNameTextRange(CompilationUnit astRoot); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceClassFile.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceClassFile.java deleted file mode 100644 index 68b71ae59d..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceClassFile.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - - -/** - * Java class file - * - * 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. - * - * @version 2.2 - * @since 2.2 - */ -public interface JavaResourceClassFile - extends JavaResourceNode -{ - /** - * Return the class file's persistent type. - */ - JavaResourcePersistentType getPersistentType(); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceCompilationUnit.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceCompilationUnit.java deleted file mode 100644 index b3e0f26a62..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceCompilationUnit.java +++ /dev/null @@ -1,68 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.jdt.core.ICompilationUnit; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.utility.jdt.AnnotationEditFormatter; -import org.eclipse.jpt.utility.CommandExecutor; - -/** - * Dali resource for JDT compilation unit. - * - * 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. - * - * @version 2.3 - * @since 2.2 - */ -public interface JavaResourceCompilationUnit - extends JavaResourceNode.Root -{ - /** - * Return the corresponding JDT compilation unit. - */ - ICompilationUnit getCompilationUnit(); - - /** - * Return the JPA project's annotation formatter. This is used to make any - * manipulated annotations reasonably readable after being written to the - * Java source file. - */ - AnnotationEditFormatter getAnnotationEditFormatter(); - - /** - * This allows the resource model to modify the Java source code on the - * UI thread when it is executing on another thread. - */ - CommandExecutor getModifySharedDocumentCommandExecutor(); - - /** - * Resolve type information that could be dependent on other files being - * added/removed. - */ - void resolveTypes(); - - /** - * Something in Java has changed (typically either the compilation unit's - * source code or the Java classpath); synchronize the compilation unit's - * state with the Java source code etc. - */ - void synchronizeWithJavaSource(); - - /** - * Build an AST for the compilation unit with its bindings resolved. - */ - CompilationUnit buildASTRoot(); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceNode.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceNode.java deleted file mode 100644 index 7b536e4fd5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourceNode.java +++ /dev/null @@ -1,100 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import java.util.Iterator; - -import org.eclipse.core.resources.IFile; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.JptResourceModel; -import org.eclipse.jpt.common.core.utility.TextRange; -import org.eclipse.jpt.core.JpaAnnotationProvider; -import org.eclipse.jpt.utility.model.Model; - -/** - * Common interface for Java resource nodes (source code or binary). - * <p> - * 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. - * - * @version 2.3 - * @since 2.0 - */ -public interface JavaResourceNode - extends Model -{ - /** - * Return the node's parent node. - */ - JavaResourceNode getParent(); - - /** - * Return the Eclipse file that contains the Java resource node - * (typically either a Java source code file or a JAR). - */ - IFile getFile(); - - /** - * Return the root of the Java resource containment hierarchy - * (typically either a compilation unit or a package fragment root). - */ - Root getRoot(); - - /** - * Return the [source] node's root (the compilation unit). - */ - // TODO get rid of this method...? - JavaResourceCompilationUnit getJavaResourceCompilationUnit(); - - /** - * Return the [source] node's text range in the compilation unit's file. - */ - TextRange getTextRange(CompilationUnit astRoot); - - /** - * Initialize the [source] node from the specified AST. - */ - void initialize(CompilationUnit astRoot); - - /** - * Synchronize the [source] node with the specified AST. - */ - void synchronizeWith(CompilationUnit astRoot); - - - /** - * Root of Java resource model containment hierarchy. - */ - interface Root extends JavaResourceNode, JptResourceModel { - - /** - * Return the root's Java resource persistent types. - */ - Iterator<JavaResourcePersistentType> persistentTypes(); - String PERSISTENT_TYPES_COLLECTION = "persistentTypes"; //$NON-NLS-1$ - - /** - * Called (via a hook in change notification) whenever anything in the - * Java resource model changes. Forwarded to listeners. - */ - void resourceModelChanged(); - - /** - * Return the annotation provider that supplies the annotations found - * in the Java resource model. - */ - JpaAnnotationProvider getAnnotationProvider(); - - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePackage.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePackage.java deleted file mode 100644 index a3ced23fdd..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePackage.java +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Red Hat, Inc. - * Distributed under license by Red Hat, Inc. All rights reserved. - * This program is made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributor: - * Red Hat, Inc. - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * @author Dmitry Geraskov - * - * Java source code of package-info - * <p> - * 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. - */ -public interface JavaResourcePackage - extends - JavaResourceAnnotatedElement -{ - - /** - * The Java resource persistent package's name. - */ - String getName(); - String NAME_PROPERTY = "name"; //$NON-NLS-1$ - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePackageFragment.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePackageFragment.java deleted file mode 100644 index 1a2d4d7f8c..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePackageFragment.java +++ /dev/null @@ -1,46 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import java.util.Iterator; - -/** - * Java package fragment - * - * 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. - * - * @version 2.2 - * @since 2.2 - */ -public interface JavaResourcePackageFragment - extends JavaResourceNode -{ - /** - * Return the package fragment's class files that contain "persistable" types. - */ - Iterator<JavaResourceClassFile> classFiles(); - String CLASS_FILES_COLLECTION = "classFiles"; //$NON-NLS-1$ - - /** - * Return the size of the package fragment's class files. - */ - int classFilesSize(); - - /** - * Return the package fragment's Java persistent types. - * Return only the files that are annotated with JPA annotations. - */ - Iterator<JavaResourcePersistentType> persistedTypes(); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePackageFragmentRoot.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePackageFragmentRoot.java deleted file mode 100644 index 6b9db9c0db..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePackageFragmentRoot.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import java.util.Iterator; - -/** - * Java package fragement root - * - * 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. - * - * @version 2.2 - * @since 2.2 - */ -public interface JavaResourcePackageFragmentRoot - extends JavaResourceNode.Root -{ - /** - * Return the package fragment root's package fragments. - */ - Iterator<JavaResourcePackageFragment> packageFragments(); - String PACKAGE_FRAGMENTS_COLLECTION = "packageFragments"; //$NON-NLS-1$ - - /** - * Return the size of the package fragment root's package fragments. - */ - int packageFragmentsSize(); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePackageInfoCompilationUnit.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePackageInfoCompilationUnit.java deleted file mode 100644 index 2ea130ad09..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePackageInfoCompilationUnit.java +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Dali resource for JDT compilation unit named package-info.java. - * - * 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. - * - * @version 3.0 - * @since 3.0 - */ -public interface JavaResourcePackageInfoCompilationUnit - extends JavaResourceCompilationUnit -{ - JavaResourcePackage getPackage(); - String PACKAGE = "package"; //$NON-NLS-1$ - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentAttribute.java deleted file mode 100644 index fddae4d392..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentAttribute.java +++ /dev/null @@ -1,144 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import java.util.Iterator; -import java.util.ListIterator; -import org.eclipse.jpt.utility.MethodSignature; - -/** - * Java source code or binary persistent attribute (field or property) - * - * 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. - * - * @version 2.3 - * @since 2.0 - */ -//TODO handle: -// @Basic -// private String foo, bar; -public interface JavaResourcePersistentAttribute - extends JavaResourcePersistentMember -{ - - JavaResourcePersistentType getParent(); - - JavaResourcePersistentType getResourcePersistentType(); - - /** - * The Java resource persistent attribute's name does not change. - */ - String getName(); - - /** - * Return a <em>null</em> annotation for the specified annotation name. - * Return <code>null</code> if the specified annotation name is - * <code>null</code>. - * The corresponding annotation definition must implement - * {@link AnnotationDefinition#buildNullAnnotation(JavaResourcePersistentMember) - * buildNullAnnotation()}. - */ - Annotation buildNullAnnotation(String annotationName); - - /** - * Whether the Java resource persistent attribute is a field does not change. - */ - boolean isField(); - - /** - * Whether the Java resource persistent attribute is a property does not change. - */ - boolean isProperty(); - - /** - * Return the access type explicitly specified by the javax.persistence.Access annotation. - * Return null if the Access annotation is not present. - * For JPA 1.0 this is always going to return null; Access annotation is not supported in 1.0. - */ - AccessType getSpecifiedAccess(); - - /** - * Return whether the attribute's type implements or extends the specified - * type. - */ - boolean typeIsSubTypeOf(String typeName); - - /** - * Return whether the attribute's type is a "variable" primitive type - * (i.e. any primitive type except 'void'). - */ - boolean typeIsVariablePrimitive(); - - /** - * Return whether the Java resource persistent attribute is for the specified - * method. - */ - boolean isFor(MethodSignature methodSignature, int occurrence); - - /** - * @see java.lang.reflect.Modifier - */ - int getModifiers(); - String MODIFIERS_PROPERTY = "modifiers"; //$NON-NLS-1$ - - /** - * Return the resolved, qualified name of the attribute's type - * (e.g. "java.util.Collection" or "byte[]"). - * If the type is an array, this name will include the appropriate number - * of bracket pairs. - * This name will not include the type's generic type arguments - * (e.g. "java.util.Collection<java.lang.String>" will only return - * "java.util.Collection"). - * @see #typeTypeArgumentNames() - */ - String getTypeName(); - String TYPE_NAME_PROPERTY = "typeName"; //$NON-NLS-1$ - - /** - * Return whether the attribute type is an interface. - */ - boolean typeIsInterface(); - String TYPE_IS_INTERFACE_PROPERTY = "typeIsInterface"; //$NON-NLS-1$ - - /** - * Return whether the attribute type is an enum. - */ - boolean typeIsEnum(); - String TYPE_IS_ENUM_PROPERTY = "typeIsEnum"; //$NON-NLS-1$ - - /** - * Return the names of the attribute type's superclasses. - */ - ListIterator<String> typeSuperclassNames(); - String TYPE_SUPERCLASS_NAMES_LIST = "typeSuperclassNames"; //$NON-NLS-1$ - - /** - * Return the names of the attribute type's interfaces. - */ - Iterator<String> typeInterfaceNames(); - String TYPE_INTERFACE_NAMES_COLLECTION = "typeInterfaceNames"; //$NON-NLS-1$ - - /** - * Return the names of the attribute type's type arguments. - * The name for any argument that is an array will contain the appropriate - * number of bracket pairs. - * The names will not include any further generic type arguments. - */ - ListIterator<String> typeTypeArgumentNames(); - String TYPE_TYPE_ARGUMENT_NAMES_LIST = "typeTypeArgumentNames"; //$NON-NLS-1$ - - int typeTypeArgumentNamesSize(); - - String getTypeTypeArgumentName(int index); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentMember.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentMember.java deleted file mode 100644 index 2e1179f5a4..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentMember.java +++ /dev/null @@ -1,83 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.utility.Filter; - -/** - * Java source code or binary persistent member. - * <p> - * 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. - * - * @version 3.0 - * @since 2.0 - */ -public interface JavaResourcePersistentMember - extends JavaResourceAnnotatedElement -{ - - // ********** annotations ********** - - /** - * Set the specified primary annotation as the first annotation and remove - * all known persistence annotations (i.e. do not remove non-persistence - * annotations) not included in the specified list of supporting annotations. - * The specified primary annotation name can be <code>null</code> and, if - * the list of supporting annotations is empty, <em>all</em> the persistence - * annotations will be removed. - */ - Annotation setPrimaryAnnotation(String primaryAnnotationName, Iterable<String> supportingAnnotationNames); - - - // ********** queries ********** - - /** - * Return whether the underlying JDT member is persistable according to - * the JPA spec. - */ - boolean isPersistable(); - String PERSISTABLE_PROPERTY = "persistable"; //$NON-NLS-1$ - - /** - * Return whether the type is final. - */ - boolean isFinal(); - String FINAL_PROPERTY = "final"; //$NON-NLS-1$ - - /** - * Return whether the Java resource persistent member is for the specified - * member. - */ - boolean isFor(String memberName, int occurrence); - - - // ********** behavior ********** - - /** - * Resolve type information that could be dependent on changes elsewhere - * in the workspace. - */ - void resolveTypes(CompilationUnit astRoot); - - - // ********** persistable member filter ********** - - Filter<JavaResourcePersistentMember> PERSISTABLE_MEMBER_FILTER = - new Filter<JavaResourcePersistentMember>() { - public boolean accept(JavaResourcePersistentMember member) { - return member.isPersistable(); - } - }; -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentType.java deleted file mode 100644 index d337e13ba5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentType.java +++ /dev/null @@ -1,215 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import java.util.Iterator; -import org.eclipse.jdt.core.IPackageFragment; - -/** - * Java source code or binary persistent type. - * <p> - * 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. - * - * @version 3.0 - * @since 2.0 - */ -public interface JavaResourcePersistentType - extends JavaResourcePersistentMember -{ - /** - * Return the unqualified (short) type name. - */ - String getName(); - String NAME_PROPERTY = "name"; //$NON-NLS-1$ - - /** - * Return the fully qualified type name. - */ - String getQualifiedName(); - String QUALIFIED_NAME_PROPERTY = "qualifiedName"; //$NON-NLS-1$ - - /** - * Return the package name. - */ - String getPackageName(); - String PACKAGE_NAME_PROPERTY = "packageName"; //$NON-NLS-1$ - - /** - * Return the fully qualified name of the type's superclass. - */ - String getSuperclassQualifiedName(); - String SUPERCLASS_QUALIFIED_NAME_PROPERTY = "superclassQualifiedName"; //$NON-NLS-1$ - - /** - * Return the name of the type's "declaring type". - * Return <code>null</code> if the type is a top-level type. - */ - String getDeclaringTypeName(); - String DECLARING_TYPE_NAME_PROPERTY = "declaringTypeName"; //$NON-NLS-1$ - - /** - * Return whether the type is abstract. - */ - boolean isAbstract(); - String ABSTRACT_PROPERTY = "abstract"; //$NON-NLS-1$ - - /** - * Return whether the type is a member type. - */ - boolean isMemberType(); - String MEMBER_TYPE_PROPERTY = "memberType"; //$NON-NLS-1$ - - /** - * Return whether the type is static. - */ - boolean isStatic(); - String STATIC_PROPERTY = "static"; //$NON-NLS-1$ - - /** - * Return whether the type has a no-arg constructor (private, protected, or public) - */ - boolean hasNoArgConstructor(); - String NO_ARG_CONSTRUCTOR_PROPERTY = "noArgConstructor"; //$NON-NLS-1$ - - /** - * Return whether the type has a private no-arg constructor - */ - boolean hasPrivateNoArgConstructor(); - String PRIVATE_NO_ARG_CONSTRUCTOR_PROPERTY = "privateNoArgConstructor"; //$NON-NLS-1$ - - /** - * Return whether the type is annotated with any annotations that determine whether and - * how the type is persisted - */ - boolean isMapped(); - - /** - * Return whether the type has any attributes that have JPA annotations - * on them (which can be used to infer the type's access type). - */ - boolean hasAnyAnnotatedAttributes(); - - boolean isIn(IPackageFragment packageFragment); - - - // ********** types ********** - - /** - * Return the immediately nested types (children). - */ - Iterator<JavaResourcePersistentType> types(); - String TYPES_COLLECTION = "types"; //$NON-NLS-1$ - - /** - * Return all the types; the type itself, its children, its grandchildren, - * etc. - */ - Iterator<JavaResourcePersistentType> allTypes(); - - /** - * Return the immediately nested persistable types. - */ - Iterator<JavaResourcePersistentType> persistableTypes(); - - - // ********** fields ********** - - /** - * Return the type's fields. - */ - Iterator<JavaResourcePersistentAttribute> fields(); - String FIELDS_COLLECTION = "fields"; //$NON-NLS-1$ - - /** - * Return the type's persistable fields. - */ - Iterator<JavaResourcePersistentAttribute> persistableFields(); - - /** - * A convenience method that returns the persistableFields that also - * have the Access annotation with a value of FIELD - */ - Iterator<JavaResourcePersistentAttribute> persistableFieldsWithSpecifiedFieldAccess(); - - - // ********** methods ********** - - /** - * Return the type's methods. This returns *all* methods from the JDT Type - */ - Iterator<JavaResourcePersistentAttribute> methods(); - String METHODS_COLLECTION = "methods"; //$NON-NLS-1$ - - /** - * Return the type's persistable properties. This returns only the getter methods - * that match the JavaBeans criteria for JPA, hence the name properties instead of methods - */ - Iterator<JavaResourcePersistentAttribute> persistableProperties(); - - /** - * A convenience method that returns the persistableProperties that also - * have the Access annotation with a value of PROPERTY - */ - Iterator<JavaResourcePersistentAttribute> persistablePropertiesWithSpecifiedPropertyAccess(); - - - // ********** attributes ********** - - /** - * Return the type's persistable fields and properties. - */ - Iterator<JavaResourcePersistentAttribute> persistableAttributes(); - - /** - * Return the persistable properties and/or fields given the non-null specified access type - */ - Iterator<JavaResourcePersistentAttribute> persistableAttributes(AccessType specifiedAccess); - - class Tools { - // ********** Access type ********** - - /** - * Return the access type currently implied by the specified Java source - * code or class file:<ul> - * <li>if any fields are annotated => - * {@link AccessType#FIELD FIELD} - * <li>if only properties are annotated => - * {@link AccessType#PROPERTY PROPERTY} - * <li>if neither are annotated => - * <code>null</code> - * - * </ul> - */ - public static AccessType buildAccess(JavaResourcePersistentType jrpType) { - for (Iterator<JavaResourcePersistentAttribute> stream = jrpType.persistableFields(); stream.hasNext(); ) { - if (stream.next().isAnnotated()) { - // any field is annotated => FIELD - return AccessType.FIELD; - } - } - - for (Iterator<JavaResourcePersistentAttribute> stream = jrpType.persistableProperties(); stream.hasNext(); ) { - if (stream.next().isAnnotated()) { - // none of the fields are annotated and a getter is annotated => PROPERTY - return AccessType.PROPERTY; - } - } - - // nothing is annotated - return null; - } - - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentTypeCache.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentTypeCache.java deleted file mode 100644 index 46822d0961..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JavaResourcePersistentTypeCache.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.core.resources.IFile; -import org.eclipse.jdt.core.IType; - -/** - * Java persistent type cache - used to hold "external" types - * - * 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. - * - * @version 2.3 - * @since 2.2 - */ -public interface JavaResourcePersistentTypeCache - extends JavaResourceNode.Root -{ - - /** - * Return the size of the cache's persistent types. - */ - int persistentTypesSize(); - - /** - * Add a Java resource persistent type for the specified JDT type to the - * cache. Return the new type. - */ - JavaResourcePersistentType addPersistentType(IType jdtType); - - /** - * Remove all the persistent types associated with the specified JAR file. - * Return whether any persistent types were removed. - */ - boolean removePersistentTypes(IFile jarFile); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumnAnnotation.java deleted file mode 100644 index 94b9d08fee..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumnAnnotation.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * <code>javax.persistence.JoinColumn</code> - * <p> - * 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. - * - * @version 2.3 - * @since 2.0 - */ -public interface JoinColumnAnnotation - extends BaseJoinColumnAnnotation -{ - String ANNOTATION_NAME = JPA.JOIN_COLUMN; -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumnsAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumnsAnnotation.java deleted file mode 100644 index a3b93720f1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinColumnsAnnotation.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * javax.persistence.JoinColumns - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface JoinColumnsAnnotation - extends ContainerAnnotation<NestableJoinColumnAnnotation> -{ - String ANNOTATION_NAME = JPA.JOIN_COLUMNS; - - String JOIN_COLUMNS_LIST = "joinColumns"; //$NON-NLS-1$ -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinTableAnnotation.java deleted file mode 100644 index 03ac0cee62..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/JoinTableAnnotation.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import java.util.ListIterator; - -/** - * Corresponds to the JPA annotation - * <code>javax.persistence.JoinTable</code> - * <p> - * 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. - * - * @version 2.3 - * @since 2.0 - */ -public interface JoinTableAnnotation - extends ReferenceTableAnnotation -{ - String ANNOTATION_NAME = JPA.JOIN_TABLE; - - - // ********** inverse join columns ********** - - /** - * Corresponds to the 'inverseJoinColumns' element of the JoinTable annotation. - * Return an empty iterator if the element does not exist in Java. - */ - ListIterator<JoinColumnAnnotation> inverseJoinColumns(); - String INVERSE_JOIN_COLUMNS_LIST = "inverseJoinColumns"; //$NON-NLS-1$ - - /** - * Corresponds to the 'inverseJoinColumns' element of the JoinTable annotation. - */ - int inverseJoinColumnsSize(); - - /** - * Corresponds to the 'inverseJoinColumns' element of the JoinTable annotation. - */ - JoinColumnAnnotation inverseJoinColumnAt(int index); - - /** - * Corresponds to the 'inverseJoinColumns' element of the JoinTable annotation. - */ - int indexOfInverseJoinColumn(JoinColumnAnnotation joinColumn); - - /** - * Corresponds to the 'inverseJoinColumns' element of the JoinTable annotation. - */ - JoinColumnAnnotation addInverseJoinColumn(int index); - - /** - * Corresponds to the 'inverseJoinColumns' element of the JoinTable annotation. - */ - void moveInverseJoinColumn(int targetIndex, int sourceIndex); - - /** - * Corresponds to the 'inverseJoinColumns' element of the JoinTable annotation. - */ - void removeInverseJoinColumn(int index); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/LobAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/LobAnnotation.java deleted file mode 100644 index 958be2a3b9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/LobAnnotation.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * javax.persistence.Lob - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface LobAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JPA.LOB; -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToManyAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToManyAnnotation.java deleted file mode 100644 index dc9d983cc2..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToManyAnnotation.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * <code>javax.persistence.ManyToMany</code> - * <p> - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface ManyToManyAnnotation - extends OwnableRelationshipMappingAnnotation -{ - String ANNOTATION_NAME = JPA.MANY_TO_MANY; -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToOneAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToOneAnnotation.java deleted file mode 100644 index 95f3c5f5a9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ManyToOneAnnotation.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * <code>javax.persistence.ManyToOne</code> - * <p> - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface ManyToOneAnnotation - extends SingleRelationshipMappingAnnotation -{ - String ANNOTATION_NAME = JPA.MANY_TO_ONE; -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/MapKeyAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/MapKeyAnnotation.java deleted file mode 100644 index 8272fe5dd0..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/MapKeyAnnotation.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.utility.TextRange; - -/** - * Corresponds to the JPA annotation - * javax.persistence.MapKey - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface MapKeyAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JPA.MAP_KEY; - - /** - * Corresponds to the 'name' element of the MapKey annotation. - * Returns null if the element does not exist in Java. - */ - String getName(); - String NAME_PROPERTY = "name"; //$NON-NLS-1$ - - /** - * Corresponds to the 'name' element of the MapKey annotation. - * Set to null to remove the element. - */ - void setName(String name); - - /** - * Return the {@link TextRange} for the 'name' element. If the element - * does not exist return the {@link TextRange} for the MapKey annotation. - */ - TextRange getNameTextRange(CompilationUnit astRoot); - - /** - * Return whether the specified position touches the 'name' element. - * Return false if the element does not exist. - */ - boolean nameTouches(int pos, CompilationUnit astRoot); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/MappedSuperclassAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/MappedSuperclassAnnotation.java deleted file mode 100644 index 4b207148c1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/MappedSuperclassAnnotation.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * javax.persistence.MappedSuperclass - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface MappedSuperclassAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JPA.MAPPED_SUPERCLASS; -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedColumnAnnotation.java deleted file mode 100644 index de64ac2d7a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedColumnAnnotation.java +++ /dev/null @@ -1,92 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.utility.TextRange; - -/** - * Corresponds to the JPA annotations:<ul> - * <li><code>javax.persistence.Column<code> - * <li><code>javax.persistence.MapKeyColumn<code> - * <li><code>javax.persistence.JoinColumn<code> - * <li><code>javax.persistence.MapKeyJoinColumn<code> - * <li><code>javax.persistence.DiscriminatorColumn<code> - * <li><code>javax.persistence.OrderColumn<code> - * <li><code>javax.persistence.PrimaryKeyJoinColumn<code> - * </ul> - * 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. - * - * @version 2.3 - * @since 2.0 - */ -public interface NamedColumnAnnotation - extends Annotation -{ - /** - * Return whether the annotation exists in Java. - */ - boolean isSpecified(); - - - // ********** name ********** - - /** - * Corresponds to the 'name' element of the *Column annotation. - * Return null if the element does not exist in Java. - */ - String getName(); - String NAME_PROPERTY = "name"; //$NON-NLS-1$ - - /** - * Corresponds to the 'name' element of the *Column annotation. - * Set to null to remove the element. - */ - void setName(String name); - - /** - * Return the {@link TextRange} for the 'name' element. If the element - * does not exist return the {@link TextRange} for the *Column annotation. - */ - TextRange getNameTextRange(CompilationUnit astRoot); - - /** - * Return whether the specified position touches the 'name' element. - * Return false if the element does not exist. - */ - boolean nameTouches(int pos, CompilationUnit astRoot); - - - // ********** column definition ********** - - /** - * Corresponds to the 'columnDefinition' element of the *Column annotation. - * Return null if the element does not exist in Java. - */ - String getColumnDefinition(); - String COLUMN_DEFINITION_PROPERTY = "columnDefinition"; //$NON-NLS-1$ - - /** - * Corresponds to the 'columnDefinition' element of the *Column annotation. - * Set to null to remove the element. - */ - void setColumnDefinition(String columnDefinition); - - /** - * Return the {@link TextRange} for the 'columnDefinition' element. If the - * element does not exist return the {@link TextRange} for the *Column annotation. - */ - TextRange getColumnDefinitionTextRange(CompilationUnit astRoot); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedNativeQueriesAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedNativeQueriesAnnotation.java deleted file mode 100644 index d352ce9d92..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedNativeQueriesAnnotation.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * javax.persistence.NamedNativeQueries - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface NamedNativeQueriesAnnotation - extends ContainerAnnotation<NestableNamedNativeQueryAnnotation> -{ - String ANNOTATION_NAME = JPA.NAMED_NATIVE_QUERIES; - - String NAMED_NATIVE_QUERIES_LIST = "namedNativeQueries"; //$NON-NLS-1$ -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedNativeQueryAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedNativeQueryAnnotation.java deleted file mode 100644 index f6283a3de1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedNativeQueryAnnotation.java +++ /dev/null @@ -1,89 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.utility.TextRange; - - -/** - * Corresponds to the JPA annotation - * <code>javax.persistence.NamedNativeQuery</code> - * <p> - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface NamedNativeQueryAnnotation - extends QueryAnnotation -{ - String ANNOTATION_NAME = JPA.NAMED_NATIVE_QUERY; - - - // ********** result class ********** - - /** - * Corresponds to the 'resultClass' element of the NamedNativeQuery annotation. - * Return null if the element does not exist in Java. - */ - String getResultClass(); - String RESULT_CLASS_PROPERTY = "resultClass"; //$NON-NLS-1$ - - /** - * Corresponds to the 'resultClass' element of the NamedNativeQuery annotation. - * Set to null to remove the element. - */ - void setResultClass(String resultClass); - - /** - * Return the {@link TextRange} for the 'resultClass' element. If element - * does not exist return the {@link TextRange} for the NamedNativeQuery annotation. - */ - TextRange getResultClassTextRange(CompilationUnit astRoot); - - /** - * Return the named native query's fully-qualified result class name as - * resolved by the AST's bindings. - * <pre> - * @NamedNativeQuery(resultClass=Employee.class) - * </pre> - * will return <code>"model.Employee"</code> if there is an import for - * <code>model.Employee</code>. - */ - String getFullyQualifiedResultClassName(); - - - // ********** result set mapping ********** - - /** - * Corresponds to the 'resultSetMapping' element of the NamedNativeQuery annotation. - * Return null if the element does not exist in Java. - */ - String getResultSetMapping(); - String RESULT_SET_MAPPING_PROPERTY = "resultSetMapping"; //$NON-NLS-1$ - - /** - * Corresponds to the 'resultSetMapping' element of the NamedNativeQuery annotation. - * Set to null to remove the element. - */ - void setResultSetMapping(String resultSetMapping); - - /** - * Return the {@link TextRange} for the 'resultSetMapping' element. If element - * does not exist return the {@link TextRange} for the NamedNativeQuery annotation. - */ - TextRange getResultSetMappingTextRange(CompilationUnit astRoot); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedQueriesAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedQueriesAnnotation.java deleted file mode 100644 index 9f2ac815a5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedQueriesAnnotation.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * javax.persistence.NamedQueries - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface NamedQueriesAnnotation - extends ContainerAnnotation<NestableNamedQueryAnnotation> -{ - String ANNOTATION_NAME = JPA.NAMED_QUERIES; - - String NAMED_QUERIES_LIST = "namedQueries"; //$NON-NLS-1$ -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedQueryAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedQueryAnnotation.java deleted file mode 100644 index e21121a1d6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NamedQueryAnnotation.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * <code>javax.persistence.NamedQuery</code> - * <p> - * 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. - * - * @version 2.3 - * @since 2.0 - */ -public interface NamedQueryAnnotation - extends QueryAnnotation -{ - String ANNOTATION_NAME = JPA.NAMED_QUERY; -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAnnotation.java deleted file mode 100644 index 62081cf8f9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAnnotation.java +++ /dev/null @@ -1,60 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter; - -/** - * Interface for dealing with annotations that can be "nested" within arrays. - * <p> - * 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. - * - * @version 2.0 - * @since 2.0 - */ -public interface NestableAnnotation - extends Annotation -{ - /** - * Move the annotation to the specified index within its container array. - * This should only be called when the annotation is actually nested - * (as opposed to stand-alone). - */ - void moveAnnotation(int index); - - /** - * Convert the annotation from "stand-alone" to "nested" within the "container" - * annotation adapted by the specified adapter at the specified index. - * The index may have a value of only <code>0</code> or <code>1</code>. - * <p> - * This is used to convert an annotation that is part of the "combination" - * pattern where a list containing elements of the annotation - * (e.g. {@link JoinColumnAnnotation}) can be represented by either the - * annotation itself (when there is only a single element in the collection) - * or a "container" annotation (e.g. {@link JoinColumnsAnnotation}) that - * holds only a single <code>value</code> element that is the array of - * "nested" annnotations. - * - * @see #convertToStandAlone() - */ - void convertToNested(ContainerAnnotation<? extends NestableAnnotation> containerAnnotation, DeclarationAnnotationAdapter containerAnnotationAdapter, int index); - - /** - * Convert the annotation from "nested" within the "container" annotation - * to "stand-alone". - * - * @see #convertToNested(ContainerAnnotation, DeclarationAnnotationAdapter, int) - */ - void convertToStandAlone(); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAssociationOverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAssociationOverrideAnnotation.java deleted file mode 100644 index 233deaa765..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAssociationOverrideAnnotation.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * <code>javax.persistence.AssociationOverride</code> - * <p> - * 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. - * - * @version 2.2 - * @since 2.2 - */ -public interface NestableAssociationOverrideAnnotation - extends AssociationOverrideAnnotation, NestableAnnotation -{ - // combine interfaces -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAttributeOverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAttributeOverrideAnnotation.java deleted file mode 100644 index 8c45f4b4f9..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableAttributeOverrideAnnotation.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * <code>javax.persistence.AttributeOverride</code> - * <p> - * 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. - * - * @version 2.2 - * @since 2.2 - */ -public interface NestableAttributeOverrideAnnotation - extends AttributeOverrideAnnotation, NestableAnnotation -{ - // combine interfaces -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableJoinColumnAnnotation.java deleted file mode 100644 index bf208e6426..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableJoinColumnAnnotation.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * <code>javax.persistence.JoinColumn</code> - * <p> - * 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. - * - * @version 2.2 - * @since 2.2 - */ -public interface NestableJoinColumnAnnotation - extends JoinColumnAnnotation, NestableAnnotation -{ - // combine interfaces -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableNamedNativeQueryAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableNamedNativeQueryAnnotation.java deleted file mode 100644 index 72e75301c8..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableNamedNativeQueryAnnotation.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * <code>javax.persistence.NamedNativeQuery</code> - * <p> - * 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. - * - * @version 2.2 - * @since 2.2 - */ -public interface NestableNamedNativeQueryAnnotation - extends NamedNativeQueryAnnotation, NestableAnnotation -{ - // combine interfaces -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableNamedQueryAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableNamedQueryAnnotation.java deleted file mode 100644 index c90b9daab6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableNamedQueryAnnotation.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * <code>javax.persistence.NamedQuery</code> - * <p> - * 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. - * - * @version 2.3 - * @since 2.2 - */ -public interface NestableNamedQueryAnnotation - extends NamedQueryAnnotation, NestableAnnotation -{ - // combine interfaces -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestablePrimaryKeyJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestablePrimaryKeyJoinColumnAnnotation.java deleted file mode 100644 index 48b6b21bbe..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestablePrimaryKeyJoinColumnAnnotation.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * <code>javax.persistence.PrimaryKeyJoinColumn</code> - * <p> - * 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. - * - * @version 2.2 - * @since 2.2 - */ -public interface NestablePrimaryKeyJoinColumnAnnotation - extends PrimaryKeyJoinColumnAnnotation, NestableAnnotation -{ - // combine interfaces -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableQueryHintAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableQueryHintAnnotation.java deleted file mode 100644 index 8c91584a67..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableQueryHintAnnotation.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * <code>javax.persistence.QueryHint</code> - * <p> - * 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. - * - * @version 2.2 - * @since 2.2 - */ -public interface NestableQueryHintAnnotation - extends QueryHintAnnotation, NestableAnnotation -{ - // combine interfaces -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableSecondaryTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableSecondaryTableAnnotation.java deleted file mode 100644 index 6f77b82a8f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableSecondaryTableAnnotation.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * <code>javax.persistence.SecondaryTable</code> - * <p> - * 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. - * - * @version 2.2 - * @since 2.2 - */ -public interface NestableSecondaryTableAnnotation - extends SecondaryTableAnnotation, NestableAnnotation -{ - // combine interfaces -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableUniqueConstraintAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableUniqueConstraintAnnotation.java deleted file mode 100644 index 1f82c7e25f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/NestableUniqueConstraintAnnotation.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * <code>javax.persistence.UniqueConstraint</code> - * <p> - * 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. - * - * @version 2.2 - * @since 2.2 - */ -public interface NestableUniqueConstraintAnnotation - extends UniqueConstraintAnnotation, NestableAnnotation -{ - // combine interfaces -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToManyAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToManyAnnotation.java deleted file mode 100644 index abacc3812a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToManyAnnotation.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * <code>javax.persistence.OneToMany</code> - * <p> - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface OneToManyAnnotation - extends OwnableRelationshipMappingAnnotation -{ - String ANNOTATION_NAME = JPA.ONE_TO_MANY; -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToOneAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToOneAnnotation.java deleted file mode 100644 index 5fdabee093..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OneToOneAnnotation.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * <code>javax.persistence.OneToOne</code> - * <p> - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface OneToOneAnnotation - extends SingleRelationshipMappingAnnotation, OwnableRelationshipMappingAnnotation -{ - String ANNOTATION_NAME = JPA.ONE_TO_ONE; -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OrderByAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OrderByAnnotation.java deleted file mode 100644 index 6d60b25973..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OrderByAnnotation.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.utility.TextRange; - -/** - * Corresponds to the JPA annotation - * javax.persistence.OrderBy - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface OrderByAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JPA.ORDER_BY; - - /** - * Corresponds to the 'value' element of the OrderBy annotation. - * Return null if the element does not exist in the annotation. - */ - String getValue(); - String VALUE_PROPERTY = "value"; //$NON-NLS-1$ - - /** - * Corresponds to the 'value' element of the OrderBy annotation. - * Setting the element to null will not remove the OrderBy annotation. - */ - void setValue(String value); - - /** - * Return the {@link TextRange} for the 'value' element. If the element - * does not exist return the {@link TextRange} for the OrderBy annotation. - */ - TextRange getValueTextRange(CompilationUnit astRoot); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OverrideAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OverrideAnnotation.java deleted file mode 100644 index 6532645ecd..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OverrideAnnotation.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.utility.TextRange; - -/** - * Common protocol for - * javax.persistence.AttributeOverride - * javax.persistence.AssociationOverride - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface OverrideAnnotation - extends Annotation -{ - - /** - * Corresponds to the 'name' element of the override annotations. - * Return null if the element does not exist in Java. - */ - String getName(); - String NAME_PROPERTY = "name"; //$NON-NLS-1$ - - /** - * Corresponds to the 'name' element of the override annotations. - * Set to null to remove the element. - */ - void setName(String name); - - /** - * Return the {@link TextRange} for the 'name' element. If element - * does not exist return the {@link TextRange} for the override annotation. - */ - TextRange getNameTextRange(CompilationUnit astRoot); - - /** - * Return whether the specified position touches the 'name' element. - * Return false if the element does not exist in Java. - */ - boolean nameTouches(int pos, CompilationUnit astRoot); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OwnableRelationshipMappingAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OwnableRelationshipMappingAnnotation.java deleted file mode 100644 index 3c9c309580..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/OwnableRelationshipMappingAnnotation.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.utility.TextRange; - -/** - * Represents a relationship mapping annotation that may have the - * <code>mappedBy</code> element:<ul> - * <li><code>javax.persistence.ManyToMany</code> - * <li><code>javax.persistence.OneToMany</code> - * <li><code>javax.persistence.OneToOne</code> - * </ul> - * <p> - * 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. - * - * @version 2.2 - * @since 2.2 - */ -public interface OwnableRelationshipMappingAnnotation - extends RelationshipMappingAnnotation -{ -// TODO bjv rename to MappedByRelationshipMappingAnnotation - /** - * Corresponds to the 'mappedBy' element of the annotation. - * Return null if the element does not exist in Java. - */ - String getMappedBy(); - String MAPPED_BY_PROPERTY = "mappedBy"; //$NON-NLS-1$ - - /** - * Corresponds to the 'mappedBy' element of the annotation. - * Set to null to remove the element. - */ - void setMappedBy(String mappedBy); - - /** - * Return the {@link TextRange} for the 'mappedBy' element. If the element - * does not exist return the {@link TextRange} for the annotation. - */ - TextRange getMappedByTextRange(CompilationUnit astRoot); - - /** - * Return whether the specified position touches the 'mappedBy' element. - * Return false if the element does not exist. - */ - boolean mappedByTouches(int pos, CompilationUnit astRoot); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumnAnnotation.java deleted file mode 100644 index 409554f4d5..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumnAnnotation.java +++ /dev/null @@ -1,61 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.utility.TextRange; - -/** - * Corresponds to the JPA annotation - * <code>javax.persistence.PrimaryKeyJoinColumn</code> - * <p> - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface PrimaryKeyJoinColumnAnnotation - extends NamedColumnAnnotation -{ - String ANNOTATION_NAME = JPA.PRIMARY_KEY_JOIN_COLUMN; - - - // ********** referenced column name ********** - - /** - * Corresponds to the 'referencedColumnName' element of the PrimaryKeyJoinColumn annotation. - * Return null if the element does not exist in Java. - */ - String getReferencedColumnName(); - String REFERENCED_COLUMN_NAME_PROPERTY = "referencedColumnName"; //$NON-NLS-1$ - - /** - * Corresponds to the 'referencedColumnName' element of the PrimaryKeyJoinColumn annotation. - * Set the to null to remove the element. - */ - void setReferencedColumnName(String referencedColumnName); - - /** - * Return the {@link TextRange} for the 'referencedColumnName' element. - * If the element does not exist return the {@link TextRange} for the PrimaryKeyJoinColumn annotation. - */ - TextRange getReferencedColumnNameTextRange(CompilationUnit astRoot); - - /** - * Return whether the specified position touches the 'referencedColumnName' element. - * Return false if the element does not exist. - */ - boolean referencedColumnNameTouches(int pos, CompilationUnit astRoot); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumnsAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumnsAnnotation.java deleted file mode 100644 index 563ed5f012..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/PrimaryKeyJoinColumnsAnnotation.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * javax.persistence.PrimaryKeyJoinColumns - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface PrimaryKeyJoinColumnsAnnotation - extends ContainerAnnotation<NestablePrimaryKeyJoinColumnAnnotation> -{ - String ANNOTATION_NAME = JPA.PRIMARY_KEY_JOIN_COLUMNS; - - String PK_JOIN_COLUMNS_LIST = "pkJoinColumns"; //$NON-NLS-1$ -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/QueryAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/QueryAnnotation.java deleted file mode 100644 index a8ee415367..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/QueryAnnotation.java +++ /dev/null @@ -1,117 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import java.util.ListIterator; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.utility.TextRange; - -/** - * Common protocol among:<ul> - * <li><code>javax.persistence.NamedQuery</code> - * <li><code>javax.persistence.NamedNativeQuery</code> - * </ul> - * 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. - * - * @version 2.2 - * @since 2.2 - */ -public interface QueryAnnotation - extends Annotation -{ - // ********** name ********** - - /** - * Corresponds to the 'name' element of the *Query annotation. - * Return null if the element does not exist in Java. - */ - String getName(); - String NAME_PROPERTY = "name"; //$NON-NLS-1$ - - /** - * Corresponds to the 'name' element of the *Query annotation. - * Set to null to remove the element. - */ - void setName(String name); - - /** - * Return the {@link TextRange} for the 'name' element. If element - * does not exist return the {@link TextRange} for the *Query annotation. - */ - TextRange getNameTextRange(CompilationUnit astRoot); - - - // ********** query ********** - - /** - * Corresponds to the 'query' element of the *Query annotation. - * Return null if the element does not exist in Java. - */ - String getQuery(); - String QUERY_PROPERTY = "query"; //$NON-NLS-1$ - - /** - * Corresponds to the 'query' element of the *Query annotation. - * Set to null to remove the element. - */ - void setQuery(String query); - - /** - * Return the {@link TextRange} for the 'query' element. If element - * does not exist return the {@link TextRange} for the *Query annotation. - */ - TextRange getQueryTextRange(CompilationUnit astRoot); - - - // ********** hints ********** - - /** - * Corresponds to the 'hints' element of the *Query annotation. - * Return an empty iterator if the element does not exist in Java. - */ - ListIterator<QueryHintAnnotation> hints(); - String HINTS_LIST = "hints"; //$NON-NLS-1$ - - /** - * Corresponds to the 'hints' element of the *Query annotation. - */ - int hintsSize(); - - /** - * Corresponds to the 'hints' element of the *Query annotation. - */ - QueryHintAnnotation hintAt(int index); - - /** - * Corresponds to the 'hints' element of the *Query annotation. - */ - int indexOfHint(QueryHintAnnotation hint); - - /** - * Corresponds to the 'hints' element of the *Query annotation. - */ - QueryHintAnnotation addHint(int index); - - /** - * Corresponds to the 'hints' element of the *Query annotation. - */ - void moveHint(int targetIndex, int sourceIndex); - - /** - * Corresponds to the 'hints' element of the *Query annotation. - */ - void removeHint(int index); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/QueryHintAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/QueryHintAnnotation.java deleted file mode 100644 index 96dca631c6..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/QueryHintAnnotation.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.utility.TextRange; - -/** - * Corresponds to the JPA annotation - * javax.persistence.QueryHint - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface QueryHintAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JPA.QUERY_HINT; - - /** - * Corresponds to the 'name' element of the QueryHint annotation. - * Return null if the element does not exist in the annotation - */ - String getName(); - String NAME_PROPERTY = "name"; //$NON-NLS-1$ - - /** - * Corresponds to the 'name' element of the QueryHint annotation. - * Setting to null will remove the element. - */ - void setName(String name); - - /** - * Return the {@link TextRange} for the 'name' element. If the element - * does not exist return the {@link TextRange} for the QueryHint annotation. - */ - TextRange getNameTextRange(CompilationUnit astRoot); - - - /** - * Corresponds to the 'value' element of the QueryHint annotation. - * Return null if the element does not exist in the annotation - */ - String getValue(); - String VALUE_PROPERTY = "value"; //$NON-NLS-1$ - - /** - * Corresponds to the 'value' element of the QueryHint annotation. - * Setting to null will remove the element. - */ - void setValue(String value); - - /** - * Return the {@link TextRange} for the 'value' element. If the element - * does not exist return the {@link TextRange} for the QueryHint annotation. - */ - TextRange getValueTextRange(CompilationUnit astRoot); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ReferenceTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ReferenceTableAnnotation.java deleted file mode 100644 index 6a46c8dd8a..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/ReferenceTableAnnotation.java +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import java.util.ListIterator; - -/** - * Corresponds to the JPA annotations:<ul> - * <li><code>javax.persistence.JoinTable</code> - * <li><code>javax.persistence.CollectionTable</code> - * </ul> - * 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. - * - * @version 2.3 - * @since 2.3 - */ -public interface ReferenceTableAnnotation - extends BaseTableAnnotation -{ - // ********** join columns ********** - - /** - * Corresponds to the 'joinColumns' element of the JoinTable annotation. - * Return an empty iterator if the element does not exist in Java. - */ - ListIterator<JoinColumnAnnotation> joinColumns(); - String JOIN_COLUMNS_LIST = "joinColumns"; //$NON-NLS-1$ - - /** - * Corresponds to the 'joinColumns' element of the JoinTable annotation. - */ - int joinColumnsSize(); - - /** - * Corresponds to the 'joinColumns' element of the JoinTable annotation. - */ - JoinColumnAnnotation joinColumnAt(int index); - - /** - * Corresponds to the 'joinColumns' element of the JoinTable annotation. - */ - int indexOfJoinColumn(JoinColumnAnnotation joinColumn); - - /** - * Corresponds to the 'joinColumns' element of the JoinTable annotation. - */ - JoinColumnAnnotation addJoinColumn(int index); - - /** - * Corresponds to the 'joinColumns' element of the JoinTable annotation. - */ - void moveJoinColumn(int targetIndex, int sourceIndex); - - /** - * Corresponds to the 'joinColumns' element of the JoinTable annotation. - */ - void removeJoinColumn(int index); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/RelationshipMappingAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/RelationshipMappingAnnotation.java deleted file mode 100644 index 27f7b24d5f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/RelationshipMappingAnnotation.java +++ /dev/null @@ -1,153 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.utility.TextRange; - -/** - * Common protocol among the following relationship mappings:<ul> - * <li><code>javax.persistence.ManyToOne</code> - * <li><code>javax.persistence.ManyToMany</code> - * <li><code>javax.persistence.OneToMany</code> - * <li><code>javax.persistence.OneToOne</code> - * </ul> - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface RelationshipMappingAnnotation - extends Annotation -{ - /** - * Corresponds to the 'targetEntity' element of the relationship mapping - * annotations. - * Return null if the element does not exist in Java. - * Return the portion of the value preceding ".class". - * <pre> - * @ManyToMany(targetEntity=Employee.class) - * </pre> - * will return "Employee" - */ - String getTargetEntity(); - String TARGET_ENTITY_PROPERTY = "targetEntity"; //$NON-NLS-1$ - - /** - * Corresponds to the 'targetEntity' element of the relationship mapping - * annotations. - * Set to null to remove the element. - */ - void setTargetEntity(String targetEntity); - - /** - * Return the {@link TextRange} for the 'targetEntity' element. If the element - * does not exist return the {@link TextRange} for the relationship mapping annotation. - */ - TextRange getTargetEntityTextRange(CompilationUnit astRoot); - - /** - * Return the fully-qualified target entity class name as resolved by the - * AST's bindings. - * <pre> - * @ManyToMany(targetEntity=Employee.class) - * </pre> - * will return <code>"model.Employee"</code> if there is an import for - * <code>model.Employee</code>. - */ - String getFullyQualifiedTargetEntityClassName(); - - - /** - * Corresponds to the 'fetch' element of the relationship mapping annotations. - * Return null if the element does not exist in Java. - */ - FetchType getFetch(); - String FETCH_PROPERTY = "fetch"; //$NON-NLS-1$ - - /** - * Corresponds to the 'fetch' element of the relationship annotations. - * Set to null to remove the element. - */ - void setFetch(FetchType fetch); - - /** - * Return the {@link TextRange} for the 'fetch' element. If the element - * does not exist return the {@link TextRange} for the relationship mapping annotation. - */ - TextRange getFetchTextRange(CompilationUnit astRoot); - - - /** - * Corresponds to the 'cascade' element of the relationship annotations. - */ - boolean isCascadeAll(); - String CASCADE_ALL_PROPERTY = "cascadeAll"; //$NON-NLS-1$ - - /** - * Corresponds to the 'cascade' element of the relationship annotations. - */ - void setCascadeAll(boolean all); - - /** - * Corresponds to the 'cascade' element of the relationship annotations. - */ - boolean isCascadeMerge(); - String CASCADE_MERGE_PROPERTY = "cascadeMerge"; //$NON-NLS-1$ - - /** - * Corresponds to the 'cascade' element of the relationship annotations. - */ - void setCascadeMerge(boolean merge); - - /** - * Corresponds to the 'cascade' element of the relationship annotations. - */ - boolean isCascadePersist(); - String CASCADE_PERSIST_PROPERTY = "cascadePersist"; //$NON-NLS-1$ - - /** - * Corresponds to the 'cascade' element of the relationship annotations. - */ - void setCascadePersist(boolean persist); - - /** - * Corresponds to the 'cascade' element of the relationship annotations. - */ - boolean isCascadeRefresh(); - String CASCADE_REFRESH_PROPERTY = "cascadeRefresh"; //$NON-NLS-1$ - - /** - * Corresponds to the 'cascade' element of the relationship annotations. - */ - void setCascadeRefresh(boolean refresh); - - /** - * Corresponds to the 'cascade' element of the relationship annotations. - */ - boolean isCascadeRemove(); - String CASCADE_REMOVE_PROPERTY = "cascadeRemove"; //$NON-NLS-1$ - - /** - * Corresponds to the 'cascade' element of the relationship annotations. - */ - void setCascadeRemove(boolean remove); - - /** - * Return the {@link TextRange} for the 'cascade' element. If the element - * does not exist return the {@link TextRange} for the relationship mapping annotation. - */ - TextRange getCascadeTextRange(CompilationUnit astRoot); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SecondaryTableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SecondaryTableAnnotation.java deleted file mode 100644 index 4066a435e1..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SecondaryTableAnnotation.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import java.util.ListIterator; - -/** - * Corresponds to the JPA annotation - * <code>javax.persistence.SecondaryTable</code> - * <p> - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface SecondaryTableAnnotation - extends BaseTableAnnotation -{ - String ANNOTATION_NAME = JPA.SECONDARY_TABLE; - - - // ********** primary key join columns ********** - - /** - * Corresponds to the 'pkJoinColumns' element of the SecondaryTable annotation. - * Return an empty iterator if the element does not exist in Java. - */ - ListIterator<PrimaryKeyJoinColumnAnnotation> pkJoinColumns(); - String PK_JOIN_COLUMNS_LIST = "pkJoinColumns"; //$NON-NLS-1$ - - /** - * Corresponds to the 'pkJoinColumns' element of the SecondaryTable annotation. - */ - int pkJoinColumnsSize(); - - /** - * Corresponds to the 'pkJoinColumns' element of the SecondaryTable annotation. - */ - PrimaryKeyJoinColumnAnnotation pkJoinColumnAt(int index); - - /** - * Corresponds to the 'pkJoinColumns' element of the SecondaryTable annotation. - */ - int indexOfPkJoinColumn(PrimaryKeyJoinColumnAnnotation pkJoinColumn); - - /** - * Corresponds to the 'pkJoinColumns' element of the SecondaryTable annotation. - */ - PrimaryKeyJoinColumnAnnotation addPkJoinColumn(int index); - - /** - * Corresponds to the 'pkJoinColumns' element of the SecondaryTable annotation. - */ - void removePkJoinColumn(int index); - - /** - * Corresponds to the 'pkJoinColumns' element of the SecondaryTable annotation. - */ - void movePkJoinColumn(int targetIndex, int sourceIndex); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SecondaryTablesAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SecondaryTablesAnnotation.java deleted file mode 100644 index 9428050512..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SecondaryTablesAnnotation.java +++ /dev/null @@ -1,31 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * javax.persistence.SecondaryTables - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface SecondaryTablesAnnotation - extends ContainerAnnotation<NestableSecondaryTableAnnotation> -{ - String ANNOTATION_NAME = JPA.SECONDARY_TABLES; - - String SECONDARY_TABLES_LIST = "secondaryTables"; //$NON-NLS-1$ -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SequenceGeneratorAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SequenceGeneratorAnnotation.java deleted file mode 100644 index 80fb6ba7bb..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SequenceGeneratorAnnotation.java +++ /dev/null @@ -1,58 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.utility.TextRange; - -/** - * Corresponds to the JPA annotation - * javax.persistence.SequenceGenerator - * - * 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. - * - * @version 2.1 - * @since 2.0 - */ -public interface SequenceGeneratorAnnotation - extends GeneratorAnnotation -{ - String ANNOTATION_NAME = JPA.SEQUENCE_GENERATOR; - - /** - * Corresponds to the 'sequenceName' element of the *Generator annotation. - * Return null if the element does not exist in Java. - */ - String getSequenceName(); - String SEQUENCE_NAME_PROPERTY = "sequenceName"; //$NON-NLS-1$ - - /** - * Corresponds to the 'sequenceName' element of the *Generator annotation. - * Set to null to remove the element. - */ - void setSequenceName(String sequenceName); - - /** - * Return the {@link TextRange} for the 'sequenceName' element. If the element - * does not exist return the {@link TextRange} for the SequenceGenerator annotation. - */ - TextRange getSequenceNameTextRange(CompilationUnit astRoot); - - /** - * Return whether the specified position touches the 'sequenceName' element. - * Return false if the element does not exist. - */ - boolean sequenceNameTouches(int pos, CompilationUnit astRoot); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SingleRelationshipMappingAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SingleRelationshipMappingAnnotation.java deleted file mode 100644 index f802dd0a25..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/SingleRelationshipMappingAnnotation.java +++ /dev/null @@ -1,47 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.utility.TextRange; - -/** - * Common protocol among the following relationship mappings:<ul> - * <li><code>javax.persistence.ManyToOne</code> - * <li><code>javax.persistence.OneToOne</code> - * </ul> - * 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. - */ -public interface SingleRelationshipMappingAnnotation - extends RelationshipMappingAnnotation -{ - /** - * Corresponds to the optional element of a single relationship annotation. - * Returns null if the optional element does not exist in java. - */ - Boolean getOptional(); - - /** - * Corresponds to the optional element of a single relationship annotation. - * Set to null to remove the optional element. - */ - void setOptional(Boolean optional); - String OPTIONAL_PROPERTY = "optional"; //$NON-NLS-1$ - - /** - * Return the {@link TextRange} for the optional element. If the optional element - * does not exist return the {@link TextRange} for the ManyToOne annotation. - */ - TextRange getOptionalTextRange(CompilationUnit astRoot); -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableAnnotation.java deleted file mode 100644 index 3e34b84831..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableAnnotation.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * <code>javax.persistence.Table</code> - * <p> - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface TableAnnotation - extends BaseTableAnnotation -{ - String ANNOTATION_NAME = JPA.TABLE; -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableGeneratorAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableGeneratorAnnotation.java deleted file mode 100644 index 7b21de5b74..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TableGeneratorAnnotation.java +++ /dev/null @@ -1,227 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import java.util.ListIterator; -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.utility.TextRange; - -/** - * Corresponds to the JPA annotation - * javax.persistence.TableGenerator - * - * 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. - * - * @version 2.1 - * @since 2.0 - */ -public interface TableGeneratorAnnotation - extends GeneratorAnnotation -{ - String ANNOTATION_NAME = JPA.TABLE_GENERATOR; - - /** - * Corresponds to the 'table' element of the TableGenerator annotation. - * Return null if the element does not exist in Java. - */ - String getTable(); - String TABLE_PROPERTY = "table"; //$NON-NLS-1$ - - /** - * Corresponds to the 'table' element of the TableGenerator annotation. - * Set to null to remove the element. - */ - void setTable(String table); - - /** - * Return the {@link TextRange} for the 'table' element. If the element - * does not exist return the {@link TextRange} for the TableGenerator annotation. - */ - TextRange getTableTextRange(CompilationUnit astRoot); - - /** - * Return whether the specified position touches the 'table' element. - * Return false if the element does not exist. - */ - boolean tableTouches(int pos, CompilationUnit astRoot); - - - /** - * Corresponds to the 'schema' element of the TableGenerator annotation. - * Return null if the element does not exist in Java. - */ - String getSchema(); - String SCHEMA_PROPERTY = "schema"; //$NON-NLS-1$ - - /** - * Corresponds to the 'schema' element of the TableGenerator annotation. - * Set to null to remove the element. - */ - void setSchema(String schema); - - /** - * Return the {@link TextRange} for the 'schema' element. If the element - * does not exist return the {@link TextRange} for the TableGenerator annotation. - */ - TextRange getSchemaTextRange(CompilationUnit astRoot); - - /** - * Return whether the specified position touches the 'schema' element. - * Return false if the element does not exist. - */ - boolean schemaTouches(int pos, CompilationUnit astRoot); - - - /** - * Corresponds to the 'catalog' element of the TableGenerator annotation. - * Return null if the element does not exist in Java. - */ - String getCatalog(); - String CATALOG_PROPERTY = "catalog"; //$NON-NLS-1$ - - /** - * Corresponds to the 'catalog' element of the TableGenerator annotation. - * Set to null to remove the element. - */ - void setCatalog(String catalog); - - /** - * Return the {@link TextRange} for the 'catalog' element. If the element - * does not exist return the {@link TextRange} for the TableGenerator annotation. - */ - TextRange getCatalogTextRange(CompilationUnit astRoot); - - /** - * Return whether the specified position touches the 'catalog' element. - * Return false if the element does not exist. - */ - boolean catalogTouches(int pos, CompilationUnit astRoot); - - - /** - * Corresponds to the 'pkColumnName' element of the TableGenerator annotation. - * Return null if the element does not exist in Java. - */ - String getPkColumnName(); - String PK_COLUMN_NAME_PROPERTY = "pkColumnName"; //$NON-NLS-1$ - - /** - * Corresponds to the 'pkColumnName' element of the TableGenerator annotation. - * Set to null to remove the element. - */ - void setPkColumnName(String pkColumnName); - - /** - * Return the {@link TextRange} for the 'pkColumnName' element. If the element - * does not exist return the {@link TextRange} for the TableGenerator annotation. - */ - TextRange getPkColumnNameTextRange(CompilationUnit astRoot); - - /** - * Return whether the specified position touches the 'pkColumnName' element. - * Return false if the element does not exist. - */ - boolean pkColumnNameTouches(int pos, CompilationUnit astRoot); - - - /** - * Corresponds to the 'valueColumnName' element of the TableGenerator annotation. - * Return null if the element does not exist in Java. - */ - String getValueColumnName(); - String VALUE_COLUMN_NAME_PROPERTY = "valueColumnName"; //$NON-NLS-1$ - - /** - * Corresponds to the 'valueColumnName' element of the TableGenerator annotation. - * Set to null to remove the element. - */ - void setValueColumnName(String valueColumnName); - - /** - * Return the {@link TextRange} for the 'valueColumnName' element. If the element - * does not exist return the {@link TextRange} for the TableGenerator annotation. - */ - TextRange getValueColumnNameTextRange(CompilationUnit astRoot); - - /** - * Return whether the specified position touches the 'valueColumnName' element. - * Return false if the element does not exist. - */ - boolean valueColumnNameTouches(int pos, CompilationUnit astRoot); - - - /** - * Corresponds to the 'pkColumnValue' element of the TableGenerator annotation. - * Return null if the element does not exist in Java. - */ - String getPkColumnValue(); - String PK_COLUMN_VALUE_PROPERTY = "pkColumnValue"; //$NON-NLS-1$ - - /** - * Corresponds to the 'pkColumnValue' element of the TableGenerator annotation. - * Set to null to remove the element. - */ - void setPkColumnValue(String pkColumnValue); - - /** - * Return the {@link TextRange} for the 'pkColumnValue' element. If the element - * does not exist return the {@link TextRange} for the TableGenerator annotation. - */ - TextRange getPkColumnValueTextRange(CompilationUnit astRoot); - - /** - * Return whether the specified position touches the 'pkColumnValue' element. - * Return false if the element does not exist. - */ - boolean pkColumnValueTouches(int pos, CompilationUnit astRoot); - - - /** - * Corresponds to the 'uniqueConstraints' element of the TableGenerator annotation. - * Return null if the element does not exist in Java. - */ - ListIterator<UniqueConstraintAnnotation> uniqueConstraints(); - String UNIQUE_CONSTRAINTS_LIST = "uniqueConstraints"; //$NON-NLS-1$ - - /** - * Corresponds to the 'uniqueConstraints' element of the TableGenerator annotation. - */ - int uniqueConstraintsSize(); - - /** - * Corresponds to the 'uniqueConstraints' element of the TableGenerator annotation. - */ - UniqueConstraintAnnotation uniqueConstraintAt(int index); - - /** - * Corresponds to the 'uniqueConstraints' element of the TableGenerator annotation. - */ - int indexOfUniqueConstraint(UniqueConstraintAnnotation uniqueConstraint); - - /** - * Corresponds to the 'uniqueConstraints' element of the TableGenerator annotation. - */ - UniqueConstraintAnnotation addUniqueConstraint(int index); - - /** - * Corresponds to the 'uniqueConstraints' element of the TableGenerator annotation. - */ - void moveUniqueConstraint(int targetIndex, int sourceIndex); - - /** - * Corresponds to the 'uniqueConstraints' element of the TableGenerator annotation. - */ - void removeUniqueConstraint(int index); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TemporalAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TemporalAnnotation.java deleted file mode 100644 index 7bdbcfb54f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TemporalAnnotation.java +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.utility.TextRange; - -/** - * Corresponds to the JPA annotation - * javax.persistence.Temporal - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface TemporalAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JPA.TEMPORAL; - - /** - * Corresponds to the 'value' element of the Temporal annotation. - * Return null if the element does not exist in Java. - */ - TemporalType getValue(); - String VALUE_PROPERTY = "value"; //$NON-NLS-1$ - - /** - * Corresponds to the 'value' element of the Temporal annotation. - * Set to null to remove the element. - */ - void setValue(TemporalType value); - - /** - * Return the {@link TextRange} for the 'value' element. If the element - * does not exist return the {@link TextRange} for the Temporal annotation. - */ - TextRange getValueTextRange(CompilationUnit astRoot); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TemporalType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TemporalType.java deleted file mode 100644 index 1a0f652d74..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TemporalType.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA enum - * javax.persistence.TemporalType - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public enum TemporalType { - - DATE(JPA.TEMPORAL_TYPE__DATE), - TIME(JPA.TEMPORAL_TYPE__TIME), - TIMESTAMP(JPA.TEMPORAL_TYPE__TIMESTAMP); - - - private String javaAnnotationValue; - - TemporalType(String javaAnnotationValue) { - if (javaAnnotationValue == null) { - throw new NullPointerException(); - } - this.javaAnnotationValue = javaAnnotationValue; - } - - public String getJavaAnnotationValue() { - return this.javaAnnotationValue; - } - - - // ********** static methods ********** - - public static TemporalType fromJavaAnnotationValue(Object javaAnnotationValue) { - return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue); - } - - private static TemporalType fromJavaAnnotationValue_(Object javaAnnotationValue) { - for (TemporalType temporalType : TemporalType.values()) { - if (temporalType.getJavaAnnotationValue().equals(javaAnnotationValue)) { - return temporalType; - } - } - return null; - } - - public static String toJavaAnnotationValue(TemporalType temporalType) { - return (temporalType == null) ? null : temporalType.getJavaAnnotationValue(); - } - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TransientAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TransientAnnotation.java deleted file mode 100644 index e7f7df717f..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/TransientAnnotation.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * javax.persistence.Transient - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface TransientAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JPA.TRANSIENT; -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/UniqueConstraintAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/UniqueConstraintAnnotation.java deleted file mode 100644 index 0d8bb17914..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/UniqueConstraintAnnotation.java +++ /dev/null @@ -1,76 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -import java.util.ListIterator; -import org.eclipse.jdt.core.dom.CompilationUnit; - -/** - * Corresponds to the JPA annotation - * javax.persistence.UniqueConstraint - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface UniqueConstraintAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JPA.UNIQUE_CONSTRAINT; - - /** - * Corresponds to the 'columnNames' element of the UniqueConstraint annotation. - * Return null if the element does not exist in the annotation. - */ - ListIterator<String> columnNames(); - String COLUMN_NAMES_LIST = "columnNames"; //$NON-NLS-1$ - - /** - * Corresponds to the 'columnNames' element of the UniqueConstraint annotation. - */ - int columnNamesSize(); - - /** - * Corresponds to the 'columnNames' element of the UniqueConstraint annotation. - */ - void addColumnName(String columnName); - - /** - * Corresponds to the 'columnNames' element of the UniqueConstraint annotation. - */ - void addColumnName(int index, String columnName); - - /** - * Corresponds to the 'columnNames' element of the UniqueConstraint annotation. - */ - void moveColumnName(int targetIndex, int sourceIndex); - - /** - * Corresponds to the 'columnNames' element of the UniqueConstraint annotation. - */ - void removeColumnName(String columnName); - - /** - * Corresponds to the 'columnNames' element of the UniqueConstraint annotation. - */ - void removeColumnName(int index); - - /** - * Return whether the specified position touches the 'columnNames' element. - * Return false if the element does not exist. - */ - boolean columnNamesTouches(int pos, CompilationUnit astRoot); - -} diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/VersionAnnotation.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/VersionAnnotation.java deleted file mode 100644 index 852f065664..0000000000 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/java/VersionAnnotation.java +++ /dev/null @@ -1,29 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.core.resource.java; - -/** - * Corresponds to the JPA annotation - * javax.persistence.Version - * - * 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. - * - * @version 2.2 - * @since 2.0 - */ -public interface VersionAnnotation - extends Annotation -{ - String ANNOTATION_NAME = JPA.VERSION; -} |