Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Vosburgh2013-02-26 22:16:04 +0000
committerBrian Vosburgh2013-03-05 19:50:53 +0000
commit5bc484d57277118342820ab6bbbdb4e3d1a21337 (patch)
tree4618c64ce43522ce1d91a3543e34e48b81e34b6c /jpa_diagram_editor/plugins
parentcf16d8204f3fd61efbc1439a2532a3a4295cc697 (diff)
downloadwebtools.dali-5bc484d57277118342820ab6bbbdb4e3d1a21337.tar.gz
webtools.dali-5bc484d57277118342820ab6bbbdb4e3d1a21337.tar.xz
webtools.dali-5bc484d57277118342820ab6bbbdb4e3d1a21337.zip
rename JavaPersistentAttribute to JavaModifiablePersistentAttribute
Diffstat (limited to 'jpa_diagram_editor/plugins')
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/JPADiagramEditor.java6
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/command/AddAttributeCommand.java4
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/command/SetMappedByNewValueCommand.java10
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddAttributeFeature.java12
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddJPAEntityFeature.java16
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddRelationFeature.java8
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ClickAddAttributeButtonFeature.java4
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ClickAddElementCollectionButtonFeature.java4
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ClickRemoveAttributeButtonFeature.java12
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateIsARelationFeature.java4
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DeleteRelationFeature.java10
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DirectEditAttributeFeature.java10
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DirectEditJPAEntityFeature.java8
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/EmbedCollectionOfObjectsFeature.java4
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/EmbedSingleObjectFeature.java4
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/GraphicalAddAttributeFeature.java4
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/GraphicalRemoveAttributeFeature.java4
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RefactorAttributeTypeFeature.java8
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RefactorEntityFeature.java22
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveAndSaveEntityFeature.java4
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveAttributeFeature.java6
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveJPAEntityFeature.java4
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/IJPAEditorFeatureProvider.java10
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorFeatureProvider.java16
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorToolBehaviorProvider.java10
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/AbstractRelation.java14
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/HasReferanceRelation.java8
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/IBidirectionalRelation.java10
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/IRelation.java10
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/IUnidirectionalRelation.java6
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToManyBiDirRelation.java10
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToManyUniDirRelation.java6
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToOneBiDirRelation.java10
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToOneUniDirRelation.java6
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToManyUniDirRelation.java6
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToOneBiDirRelation.java10
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToOneUniDirRelation.java6
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/EntityChangeListener.java4
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPAEditorUtil.java12
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPASolver.java118
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JpaArtifactFactory.java198
41 files changed, 319 insertions, 319 deletions
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/JPADiagramEditor.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/JPADiagramEditor.java
index af2edc271c..89fb16d431 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/JPADiagramEditor.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/JPADiagramEditor.java
@@ -56,7 +56,7 @@ import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.common.utility.transformer.Transformer;
import org.eclipse.jpt.jpa.core.JpaFile;
import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
import org.eclipse.jpt.jpa.ui.JpaFileModel;
@@ -385,8 +385,8 @@ public class JPADiagramEditor extends DiagramEditor implements JpaEditorManager{
if (node != null) {
if (node.getType().isAssignableFrom(JavaPersistentType.class)) {
resource = ((JavaPersistentType) node).getResource();
- } else if (node.getType().isAssignableFrom(JavaPersistentAttribute.class)) {
- resource = ((JavaPersistentAttribute) node).getResource();
+ } else if (node.getType().isAssignableFrom(JavaModifiablePersistentAttribute.class)) {
+ resource = ((JavaModifiablePersistentAttribute) node).getResource();
}
if (resource != null && resource.exists() && (resource instanceof IFile)) {
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/command/AddAttributeCommand.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/command/AddAttributeCommand.java
index 70a22057e7..4dbb7608fe 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/command/AddAttributeCommand.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/command/AddAttributeCommand.java
@@ -27,7 +27,7 @@ import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jpt.common.utility.command.Command;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.propertypage.JPADiagramPropertyPage;
@@ -113,7 +113,7 @@ public class AddAttributeCommand implements Command {
actName, cu, type, isCollection, attrTypes, contents);
if(jpt != null) {
- JavaPersistentAttribute attr = jpt.getAttributeNamed(actName);
+ JavaModifiablePersistentAttribute attr = jpt.getAttributeNamed(actName);
int cnt = 0;
while ((attr == null) && (cnt < 25)) {
try {
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/command/SetMappedByNewValueCommand.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/command/SetMappedByNewValueCommand.java
index 2da316d763..bc34d28166 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/command/SetMappedByNewValueCommand.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/command/SetMappedByNewValueCommand.java
@@ -18,7 +18,7 @@ package org.eclipse.jpt.jpadiagrameditor.ui.internal.command;
import org.eclipse.jpt.common.core.resource.java.Annotation;
import org.eclipse.jpt.common.utility.command.Command;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
import org.eclipse.jpt.jpa.core.resource.java.OwnableRelationshipMappingAnnotation;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
@@ -31,14 +31,14 @@ public class SetMappedByNewValueCommand implements Command {
private PersistenceUnit pu;
private String inverseEntityName;
private String inverseAttributeName;
- private JavaPersistentAttribute newAt;
- private JavaPersistentAttribute oldAt;
+ private JavaModifiablePersistentAttribute newAt;
+ private JavaModifiablePersistentAttribute oldAt;
private IRelation rel;
public SetMappedByNewValueCommand(IJPAEditorFeatureProvider fp,
PersistenceUnit pu, String inverseEntityName,
- String inverseAttributeName, JavaPersistentAttribute newAt,
- JavaPersistentAttribute oldAt,
+ String inverseAttributeName, JavaModifiablePersistentAttribute newAt,
+ JavaModifiablePersistentAttribute oldAt,
IRelation rel) {
super();
this.fp =fp;
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddAttributeFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddAttributeFeature.java
index 640e2441df..9847bbdf89 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddAttributeFeature.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddAttributeFeature.java
@@ -31,7 +31,7 @@ import org.eclipse.graphiti.mm.algorithms.GraphicsAlgorithm;
import org.eclipse.graphiti.mm.algorithms.Text;
import org.eclipse.graphiti.mm.pictograms.ContainerShape;
import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.Wrp;
@@ -54,10 +54,10 @@ public class AddAttributeFeature extends AbstractAddShapeFeature {
public PictogramElement add(final IAddContext context) {
Object o = context.getNewObject();
- if (!(o instanceof JavaPersistentAttribute)) {
+ if (!(o instanceof JavaModifiablePersistentAttribute)) {
return null;
}
- final JavaPersistentAttribute newAttr = (JavaPersistentAttribute) o;
+ final JavaModifiablePersistentAttribute newAttr = (JavaModifiablePersistentAttribute) o;
getFeatureProvider().putKeyToBusinessObject(getFeatureProvider().getKeyForBusinessObject(newAttr), newAttr);
PictogramElement pe = getFeatureProvider().getPictogramElementForBusinessObject(newAttr);
@@ -78,14 +78,14 @@ public class AddAttributeFeature extends AbstractAddShapeFeature {
return (PictogramElement)wrp.getObj();
}
- private void expand(JavaPersistentAttribute jpa) {
+ private void expand(JavaModifiablePersistentAttribute jpa) {
ContainerShape attributeShape = (ContainerShape) getFeatureProvider().getPictogramElementForBusinessObject(jpa);
ICustomContext customContext = new CustomContext(new PictogramElement[] { attributeShape.getContainer() });
expandCompartmentFeature.execute(customContext);
}
- private ContainerShape graphicalAdd(ContainerShape entityShape, JavaPersistentAttribute newAttr) {
+ private ContainerShape graphicalAdd(ContainerShape entityShape, JavaModifiablePersistentAttribute newAttr) {
AddContext context = new AddContext();
context.setNewObject(newAttr);
context.setTargetContainer(entityShape);
@@ -112,7 +112,7 @@ public class AddAttributeFeature extends AbstractAddShapeFeature {
public boolean canAdd(IAddContext context) {
Object o = context.getNewObject();
- return o instanceof JavaPersistentAttribute;
+ return o instanceof JavaModifiablePersistentAttribute;
}
} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddJPAEntityFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddJPAEntityFeature.java
index 8a269f9843..0238c6f23c 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddJPAEntityFeature.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddJPAEntityFeature.java
@@ -46,7 +46,7 @@ import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.core.SourceType;
import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
@@ -285,9 +285,9 @@ public class AddJPAEntityFeature extends AbstractAddShapeFeature {
private void addCompartmentChildren(
ContainerShape containerShape, JavaPersistentType jpt,
String attributeAnnotations, String[] excludeAnnotations) {
- List<JavaPersistentAttribute> attributes = new ArrayList<JavaPersistentAttribute>();
+ List<JavaModifiablePersistentAttribute> attributes = new ArrayList<JavaModifiablePersistentAttribute>();
- for (JavaPersistentAttribute attribute : jpt.getAttributes()) {
+ for (JavaModifiablePersistentAttribute attribute : jpt.getAttributes()) {
HashSet<String> annotations = JpaArtifactFactory.instance().getAnnotationNames(attribute);
if (annotations.contains(attributeAnnotations) && canAddAttribute(annotations, excludeAnnotations)) {
attributes.add(attribute);
@@ -308,9 +308,9 @@ public class AddJPAEntityFeature extends AbstractAddShapeFeature {
}
private void addBasicAttributes(ContainerShape containerShape, JavaPersistentType jpt){
- List<JavaPersistentAttribute> attributes = new ArrayList<JavaPersistentAttribute>();
+ List<JavaModifiablePersistentAttribute> attributes = new ArrayList<JavaModifiablePersistentAttribute>();
- for (JavaPersistentAttribute attribute : jpt.getAttributes()){
+ for (JavaModifiablePersistentAttribute attribute : jpt.getAttributes()){
HashSet<String> annotations = JpaArtifactFactory.instance().getAnnotationNames(attribute);
if(!(annotations.contains(JPAEditorConstants.ANNOTATION_ID))&& !(annotations.contains(JPAEditorConstants.ANNOTATION_EMBEDDED_ID)) && !(annotations.contains(JPAEditorConstants.ANNOTATION_MANY_TO_MANY)) &&
!(annotations.contains(JPAEditorConstants.ANNOTATION_MANY_TO_ONE)) && !(annotations.contains(JPAEditorConstants.ANNOTATION_ONE_TO_MANY))&&
@@ -322,9 +322,9 @@ public class AddJPAEntityFeature extends AbstractAddShapeFeature {
}
private void addAttributes(ContainerShape entityShape,
- List<JavaPersistentAttribute> attributes) {
+ List<JavaModifiablePersistentAttribute> attributes) {
for (int i = 0; i < attributes.size(); i++) {
- JavaPersistentAttribute jpa = attributes.get(i);
+ JavaModifiablePersistentAttribute jpa = attributes.get(i);
addAttribute(jpa, entityShape);
}
}
@@ -433,7 +433,7 @@ public class AddJPAEntityFeature extends AbstractAddShapeFeature {
}
- private void addAttribute(JavaPersistentAttribute pa,
+ private void addAttribute(JavaModifiablePersistentAttribute pa,
ContainerShape compartmentShape) {
IJPAEditorFeatureProvider fp = getFeatureProvider();
fp.putKeyToBusinessObject(fp.getKeyForBusinessObject(pa), pa);
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddRelationFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddRelationFeature.java
index 5f300517c1..106715a355 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddRelationFeature.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/AddRelationFeature.java
@@ -39,7 +39,7 @@ import org.eclipse.graphiti.mm.pictograms.FreeFormConnection;
import org.eclipse.graphiti.mm.pictograms.PictogramElement;
import org.eclipse.graphiti.services.Graphiti;
import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
@@ -201,7 +201,7 @@ public class AddRelationFeature extends AbstractAddFeature {
if (RelDir.UNI.equals(direction)) {
isOptional = true;
} else {
- JavaPersistentAttribute inverse = rel.getInverse().getAttributeNamed(rel.getInverseAttributeName());
+ JavaModifiablePersistentAttribute inverse = rel.getInverse().getAttributeNamed(rel.getInverseAttributeName());
JavaAttributeMapping mapping = inverse.getMapping();
a = (OneToOneAnnotation)mapping.getMappingAnnotation();
if (a != null) {
@@ -210,7 +210,7 @@ public class AddRelationFeature extends AbstractAddFeature {
imageCreator.createCardinalityConnectionDecorator(getDiagram(), c, isOptional ? JPAEditorConstants.CARDINALITY_ZERO_ONE : JPAEditorConstants.CARDINALITY_ONE, 0.0);
}
}
- JavaPersistentAttribute owner = rel.getOwner().getAttributeNamed(rel.getOwnerAttributeName());
+ JavaModifiablePersistentAttribute owner = rel.getOwner().getAttributeNamed(rel.getOwnerAttributeName());
owner.update();
HashSet<String> annotations = JpaArtifactFactory.instance().getAnnotationNames(owner);
if(isDerivedId(annotations)){
@@ -247,7 +247,7 @@ public class AddRelationFeature extends AbstractAddFeature {
boolean isOptional = false;
imageCreator.createCardinalityConnectionDecorator(getDiagram(), c, JPAEditorConstants.CARDINALITY_ZERO_N, 0.0);
imageCreator.createCardinalityConnectionDecorator(getDiagram(), c, rel.getOwnerAttributeName(), 0.0);
- JavaPersistentAttribute owner = rel.getOwner().getAttributeNamed(rel.getOwnerAttributeName());
+ JavaModifiablePersistentAttribute owner = rel.getOwner().getAttributeNamed(rel.getOwnerAttributeName());
HashSet<String> annotations = JpaArtifactFactory.instance().getAnnotationNames(owner);
if(isDerivedId(annotations)){
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ClickAddAttributeButtonFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ClickAddAttributeButtonFeature.java
index 93781e0386..ec1a26739f 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ClickAddAttributeButtonFeature.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ClickAddAttributeButtonFeature.java
@@ -21,7 +21,7 @@ import org.eclipse.graphiti.features.context.ICreateContext;
import org.eclipse.graphiti.features.impl.AbstractCreateFeature;
import org.eclipse.graphiti.mm.pictograms.ContainerShape;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
@@ -55,7 +55,7 @@ public class ClickAddAttributeButtonFeature extends AbstractCreateFeature {
JavaPersistentType jpt = (JavaPersistentType)getFeatureProvider().getBusinessObjectForPictogramElement(entityShape);
String newAttrName = JpaArtifactFactory.instance().createNewAttribute(jpt, false, getFeatureProvider());
- JavaPersistentAttribute newAttr = (JavaPersistentAttribute) jpt.resolveAttribute(newAttrName);
+ JavaModifiablePersistentAttribute newAttr = (JavaModifiablePersistentAttribute) jpt.resolveAttribute(newAttrName);
getFeatureProvider().addAddIgnore((JavaPersistentType)newAttr.getParent(), newAttr.getName());
addGraphicalRepresentation(context, newAttr);
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ClickAddElementCollectionButtonFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ClickAddElementCollectionButtonFeature.java
index bd2a9da15d..0bc9b6e8fe 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ClickAddElementCollectionButtonFeature.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ClickAddElementCollectionButtonFeature.java
@@ -22,7 +22,7 @@ import org.eclipse.graphiti.features.context.ICreateContext;
import org.eclipse.graphiti.features.impl.AbstractCreateFeature;
import org.eclipse.graphiti.mm.pictograms.ContainerShape;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
import org.eclipse.jpt.jpa.core.jpa2.resource.java.ElementCollection2_0Annotation;
@@ -57,7 +57,7 @@ public class ClickAddElementCollectionButtonFeature extends AbstractCreateFeatur
JavaPersistentType jpt = (JavaPersistentType)getFeatureProvider().getBusinessObjectForPictogramElement(entityShape);
String newAttrName = JpaArtifactFactory.instance().createNewAttribute(jpt, true, getFeatureProvider());
- JavaPersistentAttribute newAttr = (JavaPersistentAttribute) jpt.resolveAttribute(newAttrName);
+ JavaModifiablePersistentAttribute newAttr = (JavaModifiablePersistentAttribute) jpt.resolveAttribute(newAttrName);
newAttr.setMappingKey(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
newAttr.getResourceAttribute().addAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME);
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ClickRemoveAttributeButtonFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ClickRemoveAttributeButtonFeature.java
index 0baeab0669..39e52da20b 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ClickRemoveAttributeButtonFeature.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/ClickRemoveAttributeButtonFeature.java
@@ -34,7 +34,7 @@ import org.eclipse.jpt.common.ui.internal.utility.SynchronousUiCommandExecutor;
import org.eclipse.jpt.common.utility.command.Command;
import org.eclipse.jpt.jpa.core.JpaProjectManager;
import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapsId2_0Annotation;
@@ -185,7 +185,7 @@ public class ClickRemoveAttributeButtonFeature extends DefaultDeleteFeature {
*/
private boolean hasSameEmbeddedId(JavaPersistentType jpt, String fqn){
JpaArtifactFactory jpaFactory = JpaArtifactFactory.instance();
- for(JavaPersistentAttribute jpa : ((JavaPersistentType)jpt).getAttributes()){
+ for(JavaModifiablePersistentAttribute jpa : ((JavaPersistentType)jpt).getAttributes()){
if(jpaFactory.isEmbeddedId(jpa) && JPAEditorUtil.getAttributeTypeNameWithGenerics(jpa).equals(fqn)){
return true;
}
@@ -203,7 +203,7 @@ public class ClickRemoveAttributeButtonFeature extends DefaultDeleteFeature {
*/
private void deleteFieldFromCompositePKClass(String attrName,
JavaPersistentType jpt) {
- JavaPersistentAttribute jpa = jpt.getAttributeNamed(attrName);
+ JavaModifiablePersistentAttribute jpa = jpt.getAttributeNamed(attrName);
HashSet<String> annotations = JpaArtifactFactory.instance().getAnnotationNames(jpa);
if(annotations.contains(JPAEditorConstants.ANNOTATION_ONE_TO_ONE) || annotations.contains(JPAEditorConstants.ANNOTATION_MANY_TO_ONE)){
if(annotations.contains(JPAEditorConstants.ANNOTATION_ID)){
@@ -221,14 +221,14 @@ public class ClickRemoveAttributeButtonFeature extends DefaultDeleteFeature {
* @param jpa - the attribute to be deleted
*/
private void deleteFieldFromEmbeddedIDCompositePK(JavaPersistentType jpt,
- JavaPersistentAttribute jpa) {
+ JavaModifiablePersistentAttribute jpa) {
Annotation ann = jpa.getResourceAttribute().getAnnotation(MapsId2_0Annotation.ANNOTATION_NAME);
if(ann != null) {
String attribName = ((MapsId2_0Annotation)ann).getValue();
if(attribName == null)
return;
JpaArtifactFactory jpaFactory = JpaArtifactFactory.instance();
- for(JavaPersistentAttribute jpa1 : jpt.getAttributes()){
+ for(JavaModifiablePersistentAttribute jpa1 : jpt.getAttributes()){
if(jpaFactory.isEmbeddedId(jpa1)){
String fqn = JPAEditorUtil.getAttributeTypeNameWithGenerics(jpa1);
if(isDeleteAttributeAllowed(jpt, fqn)){
@@ -276,7 +276,7 @@ public class ClickRemoveAttributeButtonFeature extends DefaultDeleteFeature {
private boolean isDeleteAttributeAllowed(JavaPersistentType jpt, String fqn){
Set<JavaPersistentType> jpts = getAllJPTWithSameIDClassOrEmbeddedId(jpt, fqn);
for(JavaPersistentType perType : jpts){
- for(JavaPersistentAttribute jpa : perType.getAttributes()){
+ for(JavaModifiablePersistentAttribute jpa : perType.getAttributes()){
HashSet<String> annotations = JpaArtifactFactory.instance().getAnnotationNames(jpa);
if((annotations.contains(JPAEditorConstants.ANNOTATION_ONE_TO_ONE) || annotations.contains(JPAEditorConstants.ANNOTATION_MANY_TO_ONE)) &&
(annotations.contains(JPAEditorConstants.ANNOTATION_ID) || annotations.contains(JPAEditorConstants.ANNOTATION_MAPS_ID))){
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateIsARelationFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateIsARelationFeature.java
index a10bec4f88..9b1c7a7e98 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateIsARelationFeature.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/CreateIsARelationFeature.java
@@ -27,7 +27,7 @@ import org.eclipse.jpt.jpa.core.JpaProject;
import org.eclipse.jpt.jpa.core.MappingKeys;
import org.eclipse.jpt.jpa.core.context.MappedSuperclass;
import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
@@ -75,7 +75,7 @@ public class CreateIsARelationFeature extends AbstractCreateConnectionFeature {
JavaPersistentType subclass = (JavaPersistentType)getPersistentType(context.getTargetAnchor());
if(JpaArtifactFactory.instance().hasOrInheritsPrimaryKey(superclass)){
- for(JavaPersistentAttribute jpa : subclass.getAttributes()){
+ for(JavaModifiablePersistentAttribute jpa : subclass.getAttributes()){
if(jpa.getMappingKey().equals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY)){
jpa.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
} else if(jpa.getMappingKey().equals(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY)) {
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DeleteRelationFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DeleteRelationFeature.java
index 18e3e03249..1745cc9ce0 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DeleteRelationFeature.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DeleteRelationFeature.java
@@ -22,7 +22,7 @@ import org.eclipse.graphiti.mm.pictograms.PictogramElement;
import org.eclipse.graphiti.ui.features.DefaultDeleteFeature;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
@@ -105,7 +105,7 @@ public class DeleteRelationFeature extends DefaultDeleteFeature{
private void deleteEmbeddedRelation(Object businessObjectForPictogramElement) {
HasReferanceRelation rel = (HasReferanceRelation)businessObjectForPictogramElement;
- JavaPersistentAttribute attribute = rel.getEmbeddedAnnotatedAttribute();
+ JavaModifiablePersistentAttribute attribute = rel.getEmbeddedAnnotatedAttribute();
PictogramElement textShape = getFeatureProvider().getPictogramElementForBusinessObject(attribute);
if(textShape == null)
return;
@@ -119,7 +119,7 @@ public class DeleteRelationFeature extends DefaultDeleteFeature{
if (rel instanceof IUnidirectionalRelation) {
IUnidirectionalRelation relation = (IUnidirectionalRelation)rel;
- JavaPersistentAttribute attribute = relation.getAnnotatedAttribute();
+ JavaModifiablePersistentAttribute attribute = relation.getAnnotatedAttribute();
PictogramElement textShape = getFeatureProvider().getPictogramElementForBusinessObject(attribute);
if(textShape == null)
return;
@@ -132,14 +132,14 @@ public class DeleteRelationFeature extends DefaultDeleteFeature{
IBidirectionalRelation relation = (IBidirectionalRelation)(rel);
ClickRemoveAttributeButtonFeature feat = new ClickRemoveAttributeButtonFeature(getFeatureProvider());
- JavaPersistentAttribute ownerAttribute = relation.getOwnerAnnotatedAttribute();
+ JavaModifiablePersistentAttribute ownerAttribute = relation.getOwnerAnnotatedAttribute();
PictogramElement ownerAttributeTextShape = getFeatureProvider().getPictogramElementForBusinessObject(ownerAttribute);
if(ownerAttributeTextShape == null)
return;
IDeleteContext deleteOwnerAttributeContext = new DeleteContext(ownerAttributeTextShape);
feat.delete(deleteOwnerAttributeContext, false);
- JavaPersistentAttribute inverseAttribute = relation.getInverseAnnotatedAttribute();
+ JavaModifiablePersistentAttribute inverseAttribute = relation.getInverseAnnotatedAttribute();
PictogramElement inverseAttributeTextShape = getFeatureProvider().getPictogramElementForBusinessObject(inverseAttribute);
if(inverseAttributeTextShape == null)
return;
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DirectEditAttributeFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DirectEditAttributeFeature.java
index 8b1bcbda66..419516b917 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DirectEditAttributeFeature.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DirectEditAttributeFeature.java
@@ -30,7 +30,7 @@ import org.eclipse.graphiti.mm.algorithms.Text;
import org.eclipse.graphiti.mm.pictograms.PictogramElement;
import org.eclipse.jdt.core.JavaConventions;
import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
@@ -60,7 +60,7 @@ public class DirectEditAttributeFeature extends AbstractDirectEditingFeature {
public String getInitialValue(IDirectEditingContext context) {
PictogramElement pe = context.getPictogramElement();
- JavaPersistentAttribute jpa = (JavaPersistentAttribute)getFeatureProvider().
+ JavaModifiablePersistentAttribute jpa = (JavaModifiablePersistentAttribute)getFeatureProvider().
getBusinessObjectForPictogramElement(pe);
isMethodAnnotated = JpaArtifactFactory.instance().isMethodAnnotated(jpa);
Text txt = (Text) pe.getGraphicsAlgorithm().getGraphicsAlgorithmChildren().get(0);
@@ -85,8 +85,8 @@ public class DirectEditAttributeFeature extends AbstractDirectEditingFeature {
private IStatus checkDuplicateAttribute(String value, IDirectEditingContext context) {
PictogramElement pe = context.getPictogramElement();
- JavaPersistentAttribute oldAt = (JavaPersistentAttribute) getBusinessObjectForPictogramElement(pe);
- JavaPersistentAttribute newAl = ((JavaPersistentType)oldAt.getParent()).getAttributeNamed(value);
+ JavaModifiablePersistentAttribute oldAt = (JavaModifiablePersistentAttribute) getBusinessObjectForPictogramElement(pe);
+ JavaModifiablePersistentAttribute newAl = ((JavaPersistentType)oldAt.getParent()).getAttributeNamed(value);
if (newAl != null && !newAl.equals(oldAt)) {
String message = MessageFormat.format(JPAEditorMessages.DirectEditAttributeFeature_attributeExists, value);
return new Status(IStatus.ERROR, JPADiagramEditorPlugin.PLUGIN_ID, message);
@@ -104,7 +104,7 @@ public class DirectEditAttributeFeature extends AbstractDirectEditingFeature {
if (isMethodAnnotated)
value = JPAEditorUtil.produceValidAttributeName(value);
PictogramElement pe = context.getPictogramElement();
- JavaPersistentAttribute oldAt = (JavaPersistentAttribute) getBusinessObjectForPictogramElement(pe);
+ JavaModifiablePersistentAttribute oldAt = (JavaModifiablePersistentAttribute) getBusinessObjectForPictogramElement(pe);
IRelation rel = getFeatureProvider().getRelationRelatedToAttribute(oldAt);
String inverseJPTName = null;
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DirectEditJPAEntityFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DirectEditJPAEntityFeature.java
index 636e0872d9..daca15f0ce 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DirectEditJPAEntityFeature.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/DirectEditJPAEntityFeature.java
@@ -32,7 +32,7 @@ import org.eclipse.graphiti.mm.pictograms.ContainerShape;
import org.eclipse.graphiti.mm.pictograms.PictogramElement;
import org.eclipse.graphiti.mm.pictograms.Shape;
import org.eclipse.jdt.core.Signature;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
@@ -135,10 +135,10 @@ public class DirectEditJPAEntityFeature extends AbstractDirectEditingFeature {
}
});
- Set<JavaPersistentAttribute> ats = JpaArtifactFactory.instance().getRelatedAttributes(jpt);
- Iterator<JavaPersistentAttribute> it = ats.iterator();
+ Set<JavaModifiablePersistentAttribute> ats = JpaArtifactFactory.instance().getRelatedAttributes(jpt);
+ Iterator<JavaModifiablePersistentAttribute> it = ats.iterator();
while (it.hasNext()) {
- JavaPersistentAttribute at = it.next();
+ JavaModifiablePersistentAttribute at = it.next();
PictogramElement pel = getFeatureProvider().getPictogramElementForBusinessObject(at);
String newAtName = JPAEditorUtil.decapitalizeFirstLetter(value);
if (JpaArtifactFactory.instance().isMethodAnnotated(at))
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/EmbedCollectionOfObjectsFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/EmbedCollectionOfObjectsFeature.java
index d25e6ead97..8c7241f4b3 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/EmbedCollectionOfObjectsFeature.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/EmbedCollectionOfObjectsFeature.java
@@ -31,7 +31,7 @@ import org.eclipse.jpt.jpa.core.context.Entity;
import org.eclipse.jpt.jpa.core.context.MappedSuperclass;
import org.eclipse.jpt.jpa.core.context.PersistentType;
import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
@@ -89,7 +89,7 @@ public class EmbedCollectionOfObjectsFeature extends AbstractCreateConnectionFea
mapKeyType = "java.lang.String"; //$NON-NLS-1$
}
- JavaPersistentAttribute embeddedAttribute = JPAEditorUtil.addAnnotatedAttribute(getFeatureProvider(), embeddingEntity, embeddable, true, mapKeyType);
+ JavaModifiablePersistentAttribute embeddedAttribute = JPAEditorUtil.addAnnotatedAttribute(getFeatureProvider(), embeddingEntity, embeddable, true, mapKeyType);
embeddedAttribute.setMappingKey(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
embeddedAttribute.getResourceAttribute().addAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME);
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/EmbedSingleObjectFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/EmbedSingleObjectFeature.java
index 7163395897..e9f2a9dc88 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/EmbedSingleObjectFeature.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/EmbedSingleObjectFeature.java
@@ -28,7 +28,7 @@ import org.eclipse.jpt.jpa.core.MappingKeys;
import org.eclipse.jpt.jpa.core.context.Entity;
import org.eclipse.jpt.jpa.core.context.MappedSuperclass;
import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
@@ -78,7 +78,7 @@ public class EmbedSingleObjectFeature extends AbstractCreateConnectionFeature {
JavaPersistentType embeddingEntity = (JavaPersistentType)getPersistentType(context.getSourceAnchor());
JavaPersistentType embeddable = (JavaPersistentType)getPersistentType(context.getTargetAnchor());
- JavaPersistentAttribute embeddedAttribute = JPAEditorUtil.addAnnotatedAttribute(getFeatureProvider(), embeddingEntity, embeddable, false, null);
+ JavaModifiablePersistentAttribute embeddedAttribute = JPAEditorUtil.addAnnotatedAttribute(getFeatureProvider(), embeddingEntity, embeddable, false, null);
embeddedAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
embeddedAttribute.getResourceAttribute().addAnnotation(EmbeddedAnnotation.ANNOTATION_NAME);
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/GraphicalAddAttributeFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/GraphicalAddAttributeFeature.java
index ce12bb11bb..b3901033a4 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/GraphicalAddAttributeFeature.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/GraphicalAddAttributeFeature.java
@@ -29,7 +29,7 @@ import org.eclipse.graphiti.mm.algorithms.Text;
import org.eclipse.graphiti.mm.pictograms.ContainerShape;
import org.eclipse.graphiti.mm.pictograms.PictogramElement;
import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.JPAEditorImageProvider;
@@ -54,7 +54,7 @@ public class GraphicalAddAttributeFeature extends AbstractAddShapeFeature {
ted.getCommandStack().execute(new RecordingCommand(ted) {
@Override
protected void doExecute() {
- JavaPersistentAttribute newAttr = (JavaPersistentAttribute) context.getNewObject();
+ JavaModifiablePersistentAttribute newAttr = (JavaModifiablePersistentAttribute) context.getNewObject();
String txt = JPAEditorUtil.getText(newAttr);
HashSet<String> annots = JpaArtifactFactory.instance().getAnnotationNames(newAttr);
ContainerShape textShape = null;
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/GraphicalRemoveAttributeFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/GraphicalRemoveAttributeFeature.java
index 3ebd97ccb0..dad775d9fd 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/GraphicalRemoveAttributeFeature.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/GraphicalRemoveAttributeFeature.java
@@ -29,7 +29,7 @@ import org.eclipse.graphiti.mm.pictograms.ContainerShape;
import org.eclipse.graphiti.mm.pictograms.PictogramElement;
import org.eclipse.graphiti.mm.pictograms.Shape;
import org.eclipse.graphiti.services.Graphiti;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.GraphicsUpdater;
@@ -93,7 +93,7 @@ public class GraphicalRemoveAttributeFeature extends AbstractCustomFeature {
AddContext addContext = new AddContext();
addContext.setTargetContainer(entityShape);
- for (JavaPersistentAttribute attribute : javaPersistentType.getAttributes()) {
+ for (JavaModifiablePersistentAttribute attribute : javaPersistentType.getAttributes()) {
addContext.setNewObject(attribute);
graphicalAdd.execute(addContext);
getFeatureProvider().renewAttributeJoiningStrategyPropertyListener(attribute);
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RefactorAttributeTypeFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RefactorAttributeTypeFeature.java
index 24fb6c8ea6..4aef05d89c 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RefactorAttributeTypeFeature.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RefactorAttributeTypeFeature.java
@@ -27,7 +27,7 @@ import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.dialog.SelectTypeDialog;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
@@ -52,9 +52,9 @@ public class RefactorAttributeTypeFeature extends AbstractCustomFeature {
public void execute(ICustomContext context) {
PictogramElement pe = context.getPictogramElements()[0];
Object bo = getFeatureProvider().getBusinessObjectForPictogramElement(pe);
- if ((bo == null) || (!(bo instanceof JavaPersistentAttribute)))
+ if ((bo == null) || (!(bo instanceof JavaModifiablePersistentAttribute)))
return;
- JavaPersistentAttribute jpa = (JavaPersistentAttribute)bo;
+ JavaModifiablePersistentAttribute jpa = (JavaModifiablePersistentAttribute)bo;
String typeName = JPAEditorUtil.getAttributeTypeNameWithGenerics(jpa);
String msg = MessageFormat.format(JPAEditorMessages.SelectTypeDialog_chooseAttributeTypeDialogText,
jpa.getName(), JPAEditorUtil.returnSimpleName(((PersistentType)jpa.getParent()).getName()));
@@ -74,7 +74,7 @@ public class RefactorAttributeTypeFeature extends AbstractCustomFeature {
JpaArtifactFactory.instance().deleteAttribute((JavaPersistentType)jpa.getParent(), jpa.getName(),
getFeatureProvider());
- JavaPersistentAttribute newAt = JpaArtifactFactory.instance().makeNewAttribute(getFeatureProvider(), (JavaPersistentType)jpa.getParent(),
+ JavaModifiablePersistentAttribute newAt = JpaArtifactFactory.instance().makeNewAttribute(getFeatureProvider(), (JavaPersistentType)jpa.getParent(),
null, jpa.getName(), newTypeName, jpa.getName(), newTypeName, attributeTypeTypeNames, annotations, false);
getFeatureProvider().replaceAttribute(jpa, newAt);
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RefactorEntityFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RefactorEntityFeature.java
index c37fdbcfbd..6b391095f2 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RefactorEntityFeature.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RefactorEntityFeature.java
@@ -50,7 +50,7 @@ import org.eclipse.jpt.jpa.core.JpaFile;
import org.eclipse.jpt.jpa.core.JpaPreferences;
import org.eclipse.jpt.jpa.core.JpaProject;
import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
import org.eclipse.jpt.jpa.core.resource.java.OwnableRelationshipMappingAnnotation;
@@ -68,7 +68,7 @@ import org.eclipse.ui.IWorkbenchSite;
public abstract class RefactorEntityFeature extends AbstractCustomFeature {
- protected Set<JavaPersistentAttribute> ats = null;
+ protected Set<JavaModifiablePersistentAttribute> ats = null;
protected boolean hasNameAnnotation = false;
public RefactorEntityFeature(IFeatureProvider fp) {
@@ -193,10 +193,10 @@ public abstract class RefactorEntityFeature extends AbstractCustomFeature {
GraphicsUpdater.updateHeader((ContainerShape)pict, newJPT.getSimpleName());
linkNewElement(oldJPT, pict, fp, newJPT);
- for(JavaPersistentAttribute oldAttr : oldJPT.getAttributes()){
+ for(JavaModifiablePersistentAttribute oldAttr : oldJPT.getAttributes()){
PictogramElement attrPict = fp.getPictogramElementForBusinessObject(oldAttr);
if(attrPict != null){
- for(JavaPersistentAttribute newAttr : newJPT.getAttributes()){
+ for(JavaModifiablePersistentAttribute newAttr : newJPT.getAttributes()){
if(newAttr.getName().equals(oldAttr.getName())){
linkNewElement(oldAttr, attrPict, fp, newAttr);
}
@@ -284,18 +284,18 @@ public abstract class RefactorEntityFeature extends AbstractCustomFeature {
s.release();
if ((ats == null) || hasNameAnnotation)
return;
- final Iterator<JavaPersistentAttribute> iter = ats.iterator();
+ final Iterator<JavaModifiablePersistentAttribute> iter = ats.iterator();
Runnable r = new Runnable() {
public void run() {
Hashtable<String, String> atOldToNewName = new Hashtable<String, String>();
- Set<JavaPersistentAttribute> newSelfAts = new HashSet<JavaPersistentAttribute>();
+ Set<JavaModifiablePersistentAttribute> newSelfAts = new HashSet<JavaModifiablePersistentAttribute>();
while (iter.hasNext()) {
- JavaPersistentAttribute at = iter.next();
+ JavaModifiablePersistentAttribute at = iter.next();
JavaPersistentType atParent = (JavaPersistentType) at.getParent();
ICompilationUnit cu = getFeatureProvider().getCompilationUnit(atParent);
if (!cu.exists()) {
- at = (JavaPersistentAttribute)at.getPersistenceUnit().getPersistentType(newJptName).getAttributeNamed(at.getName());
- JavaPersistentAttribute newAt = null;
+ at = (JavaModifiablePersistentAttribute)at.getPersistenceUnit().getPersistentType(newJptName).getAttributeNamed(at.getName());
+ JavaModifiablePersistentAttribute newAt = null;
try {
newAt = JpaArtifactFactory.instance().renameAttribute(atParent, at.getName(), JPAEditorUtil.returnSimpleName(newJptName), newJptName, getFeatureProvider());
} catch (InterruptedException e) {
@@ -311,9 +311,9 @@ public abstract class RefactorEntityFeature extends AbstractCustomFeature {
}
}
}
- Iterator<JavaPersistentAttribute> itr = newSelfAts.iterator();
+ Iterator<JavaModifiablePersistentAttribute> itr = newSelfAts.iterator();
while (itr.hasNext()) {
- JavaPersistentAttribute at = itr.next();
+ JavaModifiablePersistentAttribute at = itr.next();
JavaAttributeMapping m = at.getMapping();
Annotation mappingAnnotation = m.getMappingAnnotation();
if (mappingAnnotation == null)
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveAndSaveEntityFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveAndSaveEntityFeature.java
index 155e18bc38..a9127df395 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveAndSaveEntityFeature.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveAndSaveEntityFeature.java
@@ -32,7 +32,7 @@ import org.eclipse.graphiti.mm.pictograms.ContainerShape;
import org.eclipse.graphiti.mm.pictograms.PictogramElement;
import org.eclipse.graphiti.mm.pictograms.Shape;
import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JpaArtifactFactory;
@@ -55,7 +55,7 @@ public class RemoveAndSaveEntityFeature extends DefaultRemoveFeature {
for (int i = lst.size() - 1; i >= 0; i--) {
Shape textShape = lst.get(i);
Object o = fp.getBusinessObjectForPictogramElement(textShape);
- if ((o != null) && (o instanceof JavaPersistentAttribute)) {
+ if ((o != null) && (o instanceof JavaModifiablePersistentAttribute)) {
shapesForDeletion.add(textShape);
}
}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveAttributeFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveAttributeFeature.java
index 64fa4c6df6..1d42c2c96a 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveAttributeFeature.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveAttributeFeature.java
@@ -28,7 +28,7 @@ import org.eclipse.graphiti.features.impl.DefaultRemoveFeature;
import org.eclipse.graphiti.mm.pictograms.Connection;
import org.eclipse.graphiti.mm.pictograms.ContainerShape;
import org.eclipse.graphiti.mm.pictograms.PictogramElement;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
@@ -89,8 +89,8 @@ public class RemoveAttributeFeature extends DefaultRemoveFeature {
if(bo == null)
return;
- if (bo instanceof JavaPersistentAttribute) {
- JavaPersistentAttribute jpa = (JavaPersistentAttribute) bo;
+ if (bo instanceof JavaModifiablePersistentAttribute) {
+ JavaModifiablePersistentAttribute jpa = (JavaModifiablePersistentAttribute) bo;
HashSet<String> ignores = ((JPAEditorFeatureProvider) getFeatureProvider()).getAddIgnore();
if (!ignores.isEmpty()) {
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveJPAEntityFeature.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveJPAEntityFeature.java
index fdcd421ba3..9297f6205a 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveJPAEntityFeature.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/RemoveJPAEntityFeature.java
@@ -33,7 +33,7 @@ import org.eclipse.graphiti.mm.pictograms.PictogramElement;
import org.eclipse.graphiti.mm.pictograms.Shape;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
@@ -66,7 +66,7 @@ public class RemoveJPAEntityFeature extends DefaultRemoveFeature {
for (int i = lst.size() - 1; i >= 0; i--) {
Shape textShape = lst.get(i);
Object o = fp.getBusinessObjectForPictogramElement(textShape);
- if ((o != null) && (o instanceof JavaPersistentAttribute)) {
+ if ((o != null) && (o instanceof JavaModifiablePersistentAttribute)) {
shapesForDeletion.add(textShape);
}
}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/IJPAEditorFeatureProvider.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/IJPAEditorFeatureProvider.java
index d1d8397399..0f0ca84d8c 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/IJPAEditorFeatureProvider.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/IJPAEditorFeatureProvider.java
@@ -29,7 +29,7 @@ import org.eclipse.graphiti.mm.pictograms.Diagram;
import org.eclipse.graphiti.mm.pictograms.Shape;
import org.eclipse.graphiti.services.IPeService;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.util.IModelIntegrationUtil;
@@ -62,9 +62,9 @@ public interface IJPAEditorFeatureProvider extends IFeatureProvider{
public Object remove(String key, boolean save);
- public IRelation getRelationRelatedToAttribute(JavaPersistentAttribute jpa);
+ public IRelation getRelationRelatedToAttribute(JavaModifiablePersistentAttribute jpa);
- public HasReferanceRelation getEmbeddedRelationRelatedToAttribute(JavaPersistentAttribute jpa);
+ public HasReferanceRelation getEmbeddedRelationRelatedToAttribute(JavaModifiablePersistentAttribute jpa);
public Object getBusinessObjectForKey(String key);
@@ -93,9 +93,9 @@ public interface IJPAEditorFeatureProvider extends IFeatureProvider{
public int decreaseAttribsNum(Shape sh);
- public void replaceAttribute(JavaPersistentAttribute oldAt, JavaPersistentAttribute newAt);
+ public void replaceAttribute(JavaModifiablePersistentAttribute oldAt, JavaModifiablePersistentAttribute newAt);
- public void renewAttributeJoiningStrategyPropertyListener(JavaPersistentAttribute jpa);
+ public void renewAttributeJoiningStrategyPropertyListener(JavaModifiablePersistentAttribute jpa);
public IPeService getPeService();
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorFeatureProvider.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorFeatureProvider.java
index 7427104667..950569b667 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorFeatureProvider.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorFeatureProvider.java
@@ -74,7 +74,7 @@ import org.eclipse.jpt.jpa.core.JpaProject;
import org.eclipse.jpt.jpa.core.context.ModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.PersistentType;
import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
@@ -331,7 +331,7 @@ public class JPAEditorFeatureProvider extends DefaultFeatureProvider implements
} else if ((bo instanceof AbstractRelation) ||
(bo instanceof HasReferanceRelation || (bo instanceof IsARelation))) {
return new DeleteRelationFeature(this);
- } else if (bo instanceof JavaPersistentAttribute) {
+ } else if (bo instanceof JavaModifiablePersistentAttribute) {
return new ClickRemoveAttributeButtonFeature(this);
}
return null;
@@ -470,7 +470,7 @@ public class JPAEditorFeatureProvider extends DefaultFeatureProvider implements
return super.getDirectEditingFeature(context);
Object bo = getBusinessObjectForPictogramElement(pe);
if (bo != null) {
- if (bo instanceof JavaPersistentAttribute) {
+ if (bo instanceof JavaModifiablePersistentAttribute) {
return new DirectEditAttributeFeature(this);
}
}
@@ -487,7 +487,7 @@ public class JPAEditorFeatureProvider extends DefaultFeatureProvider implements
return super.getDirectEditingFeature(context);
}
- public void renewAttributeJoiningStrategyPropertyListener(JavaPersistentAttribute jpa) {
+ public void renewAttributeJoiningStrategyPropertyListener(JavaModifiablePersistentAttribute jpa) {
((JPASolver)getIndependenceSolver()).renewAttributeJoiningStrategyPropertyListener(jpa);
}
@@ -595,7 +595,7 @@ public class JPAEditorFeatureProvider extends DefaultFeatureProvider implements
return ((JPASolver)getIndependenceSolver()).containsKey(name);
}
- public void replaceAttribute(final JavaPersistentAttribute oldAt, final JavaPersistentAttribute newAt) {
+ public void replaceAttribute(final JavaModifiablePersistentAttribute oldAt, final JavaModifiablePersistentAttribute newAt) {
final PictogramElement pe = this.getPictogramElementForBusinessObject(oldAt);
if (pe == null) {
//System.err.println("PictogramElement is null\n");
@@ -639,15 +639,15 @@ public class JPAEditorFeatureProvider extends DefaultFeatureProvider implements
return (getBusinessObjectForKey(id) != null);
}
- public boolean isRelationRelatedToAttribute(JavaPersistentAttribute jpa) {
+ public boolean isRelationRelatedToAttribute(JavaModifiablePersistentAttribute jpa) {
return ((JPASolver)getIndependenceSolver()).isRelationRelatedToAttribute(jpa);
}
- public IRelation getRelationRelatedToAttribute(JavaPersistentAttribute jpa) {
+ public IRelation getRelationRelatedToAttribute(JavaModifiablePersistentAttribute jpa) {
return ((JPASolver)getIndependenceSolver()).getRelationRelatedToAttribute(jpa, this);
}
- public HasReferanceRelation getEmbeddedRelationRelatedToAttribute(JavaPersistentAttribute jpa) {
+ public HasReferanceRelation getEmbeddedRelationRelatedToAttribute(JavaModifiablePersistentAttribute jpa) {
return ((JPASolver)getIndependenceSolver()).getEmbeddedRelationToAttribute(jpa);
}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorToolBehaviorProvider.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorToolBehaviorProvider.java
index 6423eb1085..20c3fc8c77 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorToolBehaviorProvider.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/provider/JPAEditorToolBehaviorProvider.java
@@ -60,7 +60,7 @@ import org.eclipse.graphiti.tb.IContextMenuEntry;
import org.eclipse.graphiti.tb.IDecorator;
import org.eclipse.graphiti.tb.ImageDecorator;
import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.JPADiagramEditorPlugin;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.facade.EclipseFacade;
@@ -466,8 +466,8 @@ public class JPAEditorToolBehaviorProvider extends DefaultToolBehaviorProvider {
}
return JPAEditorUtil.getTooltipText((JavaPersistentType)bo, superPersistentTypeName);
} else {
- if (bo instanceof JavaPersistentAttribute) {
- return JPAEditorUtil.getTooltipText((JavaPersistentAttribute)bo);
+ if (bo instanceof JavaModifiablePersistentAttribute) {
+ return JPAEditorUtil.getTooltipText((JavaModifiablePersistentAttribute)bo);
}
}
}
@@ -683,8 +683,8 @@ public class JPAEditorToolBehaviorProvider extends DefaultToolBehaviorProvider {
PictogramElement pe = context.getPictogramElements()[0];
Object bo = getFeatureProvider().getBusinessObjectForPictogramElement(
pe);
- if (bo instanceof JavaPersistentAttribute) {
- JavaPersistentAttribute jpa = (JavaPersistentAttribute) bo;
+ if (bo instanceof JavaModifiablePersistentAttribute) {
+ JavaModifiablePersistentAttribute jpa = (JavaModifiablePersistentAttribute) bo;
IFile file = (IFile) jpa.getResource();
try {
file.setSessionProperty(new QualifiedName(null, JPAEditorMatchingStrategy.DOUBLE_CLICK), "true"); //$NON-NLS-1$
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/AbstractRelation.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/AbstractRelation.java
index a16731a796..697fef109c 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/AbstractRelation.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/AbstractRelation.java
@@ -17,15 +17,15 @@ package org.eclipse.jpt.jpadiagrameditor.ui.internal.relations;
import java.util.Hashtable;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
abstract public class AbstractRelation implements IRelation {
protected final static String SEPARATOR = ";"; //$NON-NLS-1$
protected JavaPersistentType owner;
protected JavaPersistentType inverse;
- protected JavaPersistentAttribute ownerAnnotatedAttribute;
- protected JavaPersistentAttribute inverseAnnotatedAttribute;
+ protected JavaModifiablePersistentAttribute ownerAnnotatedAttribute;
+ protected JavaModifiablePersistentAttribute inverseAnnotatedAttribute;
protected String ownerAttributeName;
protected String inverseAttributeName;
@@ -61,21 +61,21 @@ abstract public class AbstractRelation implements IRelation {
return inverse;
}
- public JavaPersistentAttribute getInverseAnnotatedAttribute() {
+ public JavaModifiablePersistentAttribute getInverseAnnotatedAttribute() {
return inverseAnnotatedAttribute;
}
- public JavaPersistentAttribute getOwnerAnnotatedAttribute() {
+ public JavaModifiablePersistentAttribute getOwnerAnnotatedAttribute() {
return ownerAnnotatedAttribute;
}
public void setOwnerAnnotatedAttribute(
- JavaPersistentAttribute ownerAnnotatedAttribute) {
+ JavaModifiablePersistentAttribute ownerAnnotatedAttribute) {
this.ownerAnnotatedAttribute = ownerAnnotatedAttribute;
}
public void setInverseAnnotatedAttribute(
- JavaPersistentAttribute inverseAnnotatedAttribute) {
+ JavaModifiablePersistentAttribute inverseAnnotatedAttribute) {
this.inverseAnnotatedAttribute = inverseAnnotatedAttribute;
}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/HasReferanceRelation.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/HasReferanceRelation.java
index 091c30eb9a..282c5bfee7 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/HasReferanceRelation.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/HasReferanceRelation.java
@@ -21,7 +21,7 @@ import java.util.Hashtable;
import org.eclipse.graphiti.mm.pictograms.Anchor;
import org.eclipse.graphiti.mm.pictograms.Connection;
import org.eclipse.graphiti.mm.pictograms.ContainerShape;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants;
@@ -34,7 +34,7 @@ public abstract class HasReferanceRelation {
public final static Hashtable<HasReferenceType, String> relTypeToIdPart = new Hashtable<HasReferenceType, String>();
- private JavaPersistentAttribute embeddedAnnotatedAttribute;
+ private JavaModifiablePersistentAttribute embeddedAnnotatedAttribute;
public static enum HasReferenceType {
SINGLE, COLLECTION
@@ -96,11 +96,11 @@ public abstract class HasReferanceRelation {
public abstract HasReferenceType getReferenceType();
- public JavaPersistentAttribute getEmbeddedAnnotatedAttribute() {
+ public JavaModifiablePersistentAttribute getEmbeddedAnnotatedAttribute() {
return embeddedAnnotatedAttribute;
}
- public void setEmbeddedAnnotatedAttribute(JavaPersistentAttribute embeddedAnnotatedAttribute) {
+ public void setEmbeddedAnnotatedAttribute(JavaModifiablePersistentAttribute embeddedAnnotatedAttribute) {
this.embeddedAnnotatedAttribute = embeddedAnnotatedAttribute;
}
}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/IBidirectionalRelation.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/IBidirectionalRelation.java
index 59ce5e2798..4de452cbd3 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/IBidirectionalRelation.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/IBidirectionalRelation.java
@@ -15,16 +15,16 @@
*******************************************************************************/
package org.eclipse.jpt.jpadiagrameditor.ui.internal.relations;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
public interface IBidirectionalRelation extends IRelation {
- public abstract JavaPersistentAttribute getOwnerAnnotatedAttribute();
+ public abstract JavaModifiablePersistentAttribute getOwnerAnnotatedAttribute();
- public abstract JavaPersistentAttribute getInverseAnnotatedAttribute();
+ public abstract JavaModifiablePersistentAttribute getInverseAnnotatedAttribute();
- public abstract void setOwnerAnnotatedAttribute(JavaPersistentAttribute ownerAnnotatedAttribute);
+ public abstract void setOwnerAnnotatedAttribute(JavaModifiablePersistentAttribute ownerAnnotatedAttribute);
- public abstract void setInverseAnnotatedAttribute(JavaPersistentAttribute inverseAnnotatedAttribute);
+ public abstract void setInverseAnnotatedAttribute(JavaModifiablePersistentAttribute inverseAnnotatedAttribute);
} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/IRelation.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/IRelation.java
index 0556846f29..59b19a7c7c 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/IRelation.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/IRelation.java
@@ -15,7 +15,7 @@
*******************************************************************************/
package org.eclipse.jpt.jpadiagrameditor.ui.internal.relations;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
public interface IRelation {
@@ -34,17 +34,17 @@ public interface IRelation {
public abstract JavaPersistentType getInverse();
- public void setOwnerAnnotatedAttribute(JavaPersistentAttribute ownerAnnotatedAttribute);
+ public void setOwnerAnnotatedAttribute(JavaModifiablePersistentAttribute ownerAnnotatedAttribute);
- public JavaPersistentAttribute getOwnerAnnotatedAttribute();
+ public JavaModifiablePersistentAttribute getOwnerAnnotatedAttribute();
- public void setInverseAnnotatedAttribute(JavaPersistentAttribute inverseAnnotatedAttribute);
+ public void setInverseAnnotatedAttribute(JavaModifiablePersistentAttribute inverseAnnotatedAttribute);
public void setOwnerAttributeName(String ownerAttributeName);
public void setInverseAttributeName(String inverseAttributeName);
- public abstract JavaPersistentAttribute getInverseAnnotatedAttribute();
+ public abstract JavaModifiablePersistentAttribute getInverseAnnotatedAttribute();
public abstract String getOwnerAttributeName();
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/IUnidirectionalRelation.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/IUnidirectionalRelation.java
index e15f046e2e..4c08330ba6 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/IUnidirectionalRelation.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/IUnidirectionalRelation.java
@@ -15,12 +15,12 @@
*******************************************************************************/
package org.eclipse.jpt.jpadiagrameditor.ui.internal.relations;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
public interface IUnidirectionalRelation extends IRelation {
- public abstract JavaPersistentAttribute getAnnotatedAttribute();
+ public abstract JavaModifiablePersistentAttribute getAnnotatedAttribute();
- public abstract void setAnnotatedAttribute(JavaPersistentAttribute at);
+ public abstract void setAnnotatedAttribute(JavaModifiablePersistentAttribute at);
} \ No newline at end of file
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToManyBiDirRelation.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToManyBiDirRelation.java
index f3f9a92438..63cb906501 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToManyBiDirRelation.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToManyBiDirRelation.java
@@ -15,7 +15,7 @@
*******************************************************************************/
package org.eclipse.jpt.jpadiagrameditor.ui.internal.relations;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.propertypage.JPADiagramPropertyPage;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
@@ -42,13 +42,13 @@ public class ManyToManyBiDirRelation extends ManyToManyRelation implements IBidi
* @see org.eclipse.jpt.jpadiagrameditor.ui.relations.BidirectionalRelation#getOwnerAnnotatedAttribute()
*/
@Override
- public JavaPersistentAttribute getOwnerAnnotatedAttribute() {
+ public JavaModifiablePersistentAttribute getOwnerAnnotatedAttribute() {
return ownerAnnotatedAttribute;
}
@Override
public void setOwnerAnnotatedAttribute(
- JavaPersistentAttribute ownerAnnotatedAttribute) {
+ JavaModifiablePersistentAttribute ownerAnnotatedAttribute) {
this.ownerAnnotatedAttribute = ownerAnnotatedAttribute;
}
@@ -56,13 +56,13 @@ public class ManyToManyBiDirRelation extends ManyToManyRelation implements IBidi
* @see org.eclipse.jpt.jpadiagrameditor.ui.relations.BidirectionalRelation#getInverseAnnotatedAttribute()
*/
@Override
- public JavaPersistentAttribute getInverseAnnotatedAttribute() {
+ public JavaModifiablePersistentAttribute getInverseAnnotatedAttribute() {
return inverseAnnotatedAttribute;
}
@Override
public void setInverseAnnotatedAttribute(
- JavaPersistentAttribute inverseAnnotatedAttribute) {
+ JavaModifiablePersistentAttribute inverseAnnotatedAttribute) {
this.inverseAnnotatedAttribute = inverseAnnotatedAttribute;
}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToManyUniDirRelation.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToManyUniDirRelation.java
index 554a1b59b8..257712d4f5 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToManyUniDirRelation.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToManyUniDirRelation.java
@@ -15,7 +15,7 @@
*******************************************************************************/
package org.eclipse.jpt.jpadiagrameditor.ui.internal.relations;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.propertypage.JPADiagramPropertyPage;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
@@ -35,11 +35,11 @@ public class ManyToManyUniDirRelation extends ManyToManyRelation implements IUni
createRelation(fp);
}
- public JavaPersistentAttribute getAnnotatedAttribute() {
+ public JavaModifiablePersistentAttribute getAnnotatedAttribute() {
return ownerAnnotatedAttribute;
}
- public void setAnnotatedAttribute(JavaPersistentAttribute annotatedAttribute) {
+ public void setAnnotatedAttribute(JavaModifiablePersistentAttribute annotatedAttribute) {
this.ownerAnnotatedAttribute = annotatedAttribute;
}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToOneBiDirRelation.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToOneBiDirRelation.java
index 90fe21d886..5fb13eabec 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToOneBiDirRelation.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToOneBiDirRelation.java
@@ -15,7 +15,7 @@
*******************************************************************************/
package org.eclipse.jpt.jpadiagrameditor.ui.internal.relations;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.propertypage.JPADiagramPropertyPage;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
@@ -40,22 +40,22 @@ public class ManyToOneBiDirRelation extends ManyToOneRelation implements IBidir
}
@Override
- public JavaPersistentAttribute getOwnerAnnotatedAttribute() {
+ public JavaModifiablePersistentAttribute getOwnerAnnotatedAttribute() {
return ownerAnnotatedAttribute;
}
@Override
- public void setOwnerAnnotatedAttribute( JavaPersistentAttribute ownerAnnotatedAttribute) {
+ public void setOwnerAnnotatedAttribute( JavaModifiablePersistentAttribute ownerAnnotatedAttribute) {
this.ownerAnnotatedAttribute = ownerAnnotatedAttribute;
}
@Override
- public JavaPersistentAttribute getInverseAnnotatedAttribute() {
+ public JavaModifiablePersistentAttribute getInverseAnnotatedAttribute() {
return inverseAnnotatedAttribute;
}
@Override
- public void setInverseAnnotatedAttribute(JavaPersistentAttribute inverseAnnotatedAttribute) {
+ public void setInverseAnnotatedAttribute(JavaModifiablePersistentAttribute inverseAnnotatedAttribute) {
this.inverseAnnotatedAttribute = inverseAnnotatedAttribute;
}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToOneUniDirRelation.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToOneUniDirRelation.java
index 1823add090..435b7d1720 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToOneUniDirRelation.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/ManyToOneUniDirRelation.java
@@ -15,7 +15,7 @@
*******************************************************************************/
package org.eclipse.jpt.jpadiagrameditor.ui.internal.relations;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
@@ -34,11 +34,11 @@ public class ManyToOneUniDirRelation extends ManyToOneRelation implements IUnidi
createRelation(fp, isDerivedIdFeature);
}
- public JavaPersistentAttribute getAnnotatedAttribute() {
+ public JavaModifiablePersistentAttribute getAnnotatedAttribute() {
return ownerAnnotatedAttribute;
}
- public void setAnnotatedAttribute(JavaPersistentAttribute annotatedAttribute) {
+ public void setAnnotatedAttribute(JavaModifiablePersistentAttribute annotatedAttribute) {
this.ownerAnnotatedAttribute = annotatedAttribute;
}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToManyUniDirRelation.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToManyUniDirRelation.java
index 5e0588a87c..e6661a8e7e 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToManyUniDirRelation.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToManyUniDirRelation.java
@@ -15,7 +15,7 @@
*******************************************************************************/
package org.eclipse.jpt.jpadiagrameditor.ui.internal.relations;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.propertypage.JPADiagramPropertyPage;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
@@ -35,11 +35,11 @@ public class OneToManyUniDirRelation extends OneToManyRelation implements IUnidi
createRelation(fp);
}
- public JavaPersistentAttribute getAnnotatedAttribute() {
+ public JavaModifiablePersistentAttribute getAnnotatedAttribute() {
return ownerAnnotatedAttribute;
}
- public void setAnnotatedAttribute(JavaPersistentAttribute annotatedAttribute) {
+ public void setAnnotatedAttribute(JavaModifiablePersistentAttribute annotatedAttribute) {
this.ownerAnnotatedAttribute = annotatedAttribute;
}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToOneBiDirRelation.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToOneBiDirRelation.java
index 264c8adb19..ac438b8988 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToOneBiDirRelation.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToOneBiDirRelation.java
@@ -15,7 +15,7 @@
*******************************************************************************/
package org.eclipse.jpt.jpadiagrameditor.ui.internal.relations;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
@@ -37,24 +37,24 @@ public class OneToOneBiDirRelation extends OneToOneRelation implements IBidirect
}
@Override
- public JavaPersistentAttribute getOwnerAnnotatedAttribute() {
+ public JavaModifiablePersistentAttribute getOwnerAnnotatedAttribute() {
return ownerAnnotatedAttribute;
}
@Override
public void setOwnerAnnotatedAttribute(
- JavaPersistentAttribute ownerAnnotatedAttribute) {
+ JavaModifiablePersistentAttribute ownerAnnotatedAttribute) {
this.ownerAnnotatedAttribute = ownerAnnotatedAttribute;
}
@Override
- public JavaPersistentAttribute getInverseAnnotatedAttribute() {
+ public JavaModifiablePersistentAttribute getInverseAnnotatedAttribute() {
return inverseAnnotatedAttribute;
}
@Override
public void setInverseAnnotatedAttribute(
- JavaPersistentAttribute inverseAnnotatedAttribute) {
+ JavaModifiablePersistentAttribute inverseAnnotatedAttribute) {
this.inverseAnnotatedAttribute = inverseAnnotatedAttribute;
}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToOneUniDirRelation.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToOneUniDirRelation.java
index 02e45e5293..ecb4c9ac52 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToOneUniDirRelation.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/relations/OneToOneUniDirRelation.java
@@ -15,7 +15,7 @@
*******************************************************************************/
package org.eclipse.jpt.jpadiagrameditor.ui.internal.relations;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider;
import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorUtil;
@@ -34,11 +34,11 @@ public class OneToOneUniDirRelation extends OneToOneRelation implements IUnidire
createRelation(fp, isDerivedIdFeature);
}
- public JavaPersistentAttribute getAnnotatedAttribute() {
+ public JavaModifiablePersistentAttribute getAnnotatedAttribute() {
return ownerAnnotatedAttribute;
}
- public void setAnnotatedAttribute(JavaPersistentAttribute annotatedAttribute) {
+ public void setAnnotatedAttribute(JavaModifiablePersistentAttribute annotatedAttribute) {
this.ownerAnnotatedAttribute = annotatedAttribute;
}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/EntityChangeListener.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/EntityChangeListener.java
index 6d7e84e096..d82eb7a1e1 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/EntityChangeListener.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/EntityChangeListener.java
@@ -28,7 +28,7 @@ import org.eclipse.jpt.jpa.core.context.MappedByRelationship;
import org.eclipse.jpt.jpa.core.context.MappedByRelationshipStrategy;
import org.eclipse.jpt.jpa.core.context.PersistentType;
import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.core.context.java.JavaRelationshipMapping;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
@@ -151,7 +151,7 @@ public class EntityChangeListener extends Thread {
String oldMappedBy = jptAndAttrib[3];
JavaPersistentType jpt = (JavaPersistentType)pu.getPersistentType(entityName);
if (jpt != null) {
- JavaPersistentAttribute jpa = jpt.getAttributeNamed(attribName);
+ JavaModifiablePersistentAttribute jpa = jpt.getAttributeNamed(attribName);
if (jpa != null) {
JavaAttributeMapping mapping = jpa.getMapping();
if (OwnableRelationshipMappingAnnotation.class.isInstance(mapping.getMappingAnnotation())) {
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPAEditorUtil.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPAEditorUtil.java
index 3455f8e93e..c3f94dd370 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPAEditorUtil.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPAEditorUtil.java
@@ -81,7 +81,7 @@ import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
import org.eclipse.jpt.common.core.resource.xml.JptXmlResource;
import org.eclipse.jpt.jpa.core.JpaProject;
import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
@@ -161,7 +161,7 @@ public class JPAEditorUtil {
return getAnchor((ContainerShape)pe);
}
- public static String getText(JavaPersistentAttribute at) {
+ public static String getText(JavaModifiablePersistentAttribute at) {
return at.getName();
}
@@ -187,7 +187,7 @@ public class JPAEditorUtil {
}
- public static String getAttributeTypeName(JavaPersistentAttribute at) {
+ public static String getAttributeTypeName(JavaModifiablePersistentAttribute at) {
return getAttributeTypeName(at.getResourceAttribute());
}
@@ -195,7 +195,7 @@ public class JPAEditorUtil {
return at.getTypeBinding().getQualifiedName();
}
- public static String getAttributeTypeNameWithGenerics(JavaPersistentAttribute at) {
+ public static String getAttributeTypeNameWithGenerics(JavaModifiablePersistentAttribute at) {
return getAttributeTypeNameWithGenerics(at.getResourceAttribute());
}
@@ -1303,7 +1303,7 @@ public class JPAEditorUtil {
}
- public static String getTooltipText(JavaPersistentAttribute at) {
+ public static String getTooltipText(JavaModifiablePersistentAttribute at) {
String res = getAttributeTypeName(at);
return MessageFormat.format(JPAEditorMessages.JPAEditorUtil_typeTooltipText, new Object[] { res });
}
@@ -1404,7 +1404,7 @@ public class JPAEditorUtil {
return h1.equals(h2);
}
- public static JavaPersistentAttribute addAnnotatedAttribute(IJPAEditorFeatureProvider fp, JavaPersistentType referencingJPT,
+ public static JavaModifiablePersistentAttribute addAnnotatedAttribute(IJPAEditorFeatureProvider fp, JavaPersistentType referencingJPT,
JavaPersistentType referencedJPT, boolean isCollection, String mapKeyType){
String name = returnSimpleName(referencedJPT.getName());
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPASolver.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPASolver.java
index a14891e406..e7cbaf48c4 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPASolver.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JPASolver.java
@@ -99,7 +99,7 @@ import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
import org.eclipse.jpt.jpa.core.context.java.JavaManyToOneMapping;
import org.eclipse.jpt.jpa.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
import org.eclipse.jpt.jpa.core.resource.java.OwnableRelationshipMappingAnnotation;
@@ -134,10 +134,10 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
private Hashtable<String, Object> keyToBO;
private WeakHashMap<JpaProject, WeakReference<CollectionChangeListener>> projectToEntityListener;
private WeakHashMap<JavaPersistentType, WeakReference<PropertyChangeListener>> entityToPropListener;
- private WeakHashMap<JavaPersistentAttribute, WeakReference<AttributePropertyChangeListener>> attributeToPropListener;
- private WeakHashMap<JavaPersistentAttribute, WeakReference<AttributeMappingOptionalityChangeListener>> attributeMappingOptionalityToPropListener;
- private WeakHashMap<JavaPersistentAttribute, WeakReference<AttributeJoiningStrategyPropertyChangeListener>> attributeJoiningStrategyToPropListener;
- private WeakHashMap<JavaPersistentAttribute, WeakReference<AttributeRelationshipReferencePropertyChangeListener>> attributeRelationshipReferenceToPropListener;
+ private WeakHashMap<JavaModifiablePersistentAttribute, WeakReference<AttributePropertyChangeListener>> attributeToPropListener;
+ private WeakHashMap<JavaModifiablePersistentAttribute, WeakReference<AttributeMappingOptionalityChangeListener>> attributeMappingOptionalityToPropListener;
+ private WeakHashMap<JavaModifiablePersistentAttribute, WeakReference<AttributeJoiningStrategyPropertyChangeListener>> attributeJoiningStrategyToPropListener;
+ private WeakHashMap<JavaModifiablePersistentAttribute, WeakReference<AttributeRelationshipReferencePropertyChangeListener>> attributeRelationshipReferenceToPropListener;
private WeakHashMap<JavaPersistentType, WeakReference<ListChangeListener>> entityToAtListener;
private WeakHashMap<JavaPersistentType, WeakReference<StateChangeListener>> entityToStateListener;
private EntityChangeListener entityNameListener;
@@ -181,10 +181,10 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
keyToBO = new Hashtable<String, Object>();
projectToEntityListener = new WeakHashMap<JpaProject, WeakReference<CollectionChangeListener>>();
entityToPropListener = new WeakHashMap<JavaPersistentType, WeakReference<PropertyChangeListener>>();
- attributeToPropListener = new WeakHashMap<JavaPersistentAttribute, WeakReference<AttributePropertyChangeListener>>();
- attributeMappingOptionalityToPropListener = new WeakHashMap<JavaPersistentAttribute, WeakReference<AttributeMappingOptionalityChangeListener>>();
- attributeJoiningStrategyToPropListener = new WeakHashMap<JavaPersistentAttribute, WeakReference<AttributeJoiningStrategyPropertyChangeListener>>();
- attributeRelationshipReferenceToPropListener = new WeakHashMap<JavaPersistentAttribute, WeakReference<AttributeRelationshipReferencePropertyChangeListener>>();
+ attributeToPropListener = new WeakHashMap<JavaModifiablePersistentAttribute, WeakReference<AttributePropertyChangeListener>>();
+ attributeMappingOptionalityToPropListener = new WeakHashMap<JavaModifiablePersistentAttribute, WeakReference<AttributeMappingOptionalityChangeListener>>();
+ attributeJoiningStrategyToPropListener = new WeakHashMap<JavaModifiablePersistentAttribute, WeakReference<AttributeJoiningStrategyPropertyChangeListener>>();
+ attributeRelationshipReferenceToPropListener = new WeakHashMap<JavaModifiablePersistentAttribute, WeakReference<AttributeRelationshipReferencePropertyChangeListener>>();
entityToAtListener = new WeakHashMap<JavaPersistentType, WeakReference<ListChangeListener>>();
entityToStateListener = new WeakHashMap<JavaPersistentType, WeakReference<StateChangeListener>>();
entityNameListener = new EntityChangeListener(this);
@@ -294,8 +294,8 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
return ((HasReferanceRelation)bo).getId();
} else if (bo instanceof IsARelation) {
return ((IsARelation)bo).getId();
- } else if (bo instanceof JavaPersistentAttribute) {
- JavaPersistentAttribute at = (JavaPersistentAttribute) bo;
+ } else if (bo instanceof JavaModifiablePersistentAttribute) {
+ JavaModifiablePersistentAttribute at = (JavaModifiablePersistentAttribute) bo;
return (((PersistentType)at.getParent()).getName() + "-" + at.getName()); //$NON-NLS-1$
}
return bo.toString();
@@ -357,8 +357,8 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
} else if (bo instanceof IsARelation) {
IsARelation rel = (IsARelation) bo;
attribToIsARel.put(produceKeyForIsARel(rel), rel);
- } else if (bo instanceof JavaPersistentAttribute) {
- addPropertiesListenerToAttribute((JavaPersistentAttribute)bo);
+ } else if (bo instanceof JavaModifiablePersistentAttribute) {
+ addPropertiesListenerToAttribute((JavaModifiablePersistentAttribute)bo);
}
}
@@ -368,7 +368,7 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
Object o = keyToBO.remove(key);
if (o instanceof JavaPersistentType) {
JavaPersistentType jpt = (JavaPersistentType) o;
- for (JavaPersistentAttribute at : jpt.getAttributes()) {
+ for (JavaModifiablePersistentAttribute at : jpt.getAttributes()) {
String k = getKeyForBusinessObject(at);
remove(k);
}
@@ -397,8 +397,8 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
} else if (o instanceof IsARelation) {
IsARelation rel = (IsARelation) o;
attribToIsARel.remove(produceKeyForIsARel(rel));
- } else if (o instanceof JavaPersistentAttribute) {
- removeListenersFromAttribute((JavaPersistentAttribute)o);
+ } else if (o instanceof JavaModifiablePersistentAttribute) {
+ removeListenersFromAttribute((JavaModifiablePersistentAttribute)o);
}
return o;
}
@@ -407,12 +407,12 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
return util.getCompilationUnit(jpt);
}
- public boolean isRelationRelatedToAttribute(JavaPersistentAttribute jpa) {
+ public boolean isRelationRelatedToAttribute(JavaModifiablePersistentAttribute jpa) {
String key = produceKeyForRel((JavaPersistentType)jpa.getParent(), jpa.getName());
return attribToRel.containsKey(key);
}
- public IRelation getRelationRelatedToAttribute(JavaPersistentAttribute jpa, IJPAEditorFeatureProvider fp) {
+ public IRelation getRelationRelatedToAttribute(JavaModifiablePersistentAttribute jpa, IJPAEditorFeatureProvider fp) {
String key = findRelationshipKey(jpa, fp);
return attribToRel.get(key);
}
@@ -426,11 +426,11 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
* that consists of the name of the attribute which will be renamed and the name of the attribute in the embeddable class. If such an attribute
* exists, the unique key for the existing relationship must be ganerated by the target entity and the name of the found attribute.
* Otherwise the key must be generated by the name of the attribute that will be renamed and its parent entity.
- * @param jpa - the {@link JavaPersistentAttribute} which will be renamed
+ * @param jpa - the {@link JavaModifiablePersistentAttribute} which will be renamed
* @param fp
* @return the unique key for the relationship.
*/
- private String findRelationshipKey(JavaPersistentAttribute jpa, IJPAEditorFeatureProvider fp){
+ private String findRelationshipKey(JavaModifiablePersistentAttribute jpa, IJPAEditorFeatureProvider fp){
JpaArtifactFactory jpaFactory = JpaArtifactFactory.instance();
if(jpaFactory.isEmbeddedAttribute(jpa)){
Annotation embeddedAn = null;
@@ -441,7 +441,7 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
JavaPersistentType embeddableClass = jpaFactory.findJPT(jpa, fp, embeddedAn);
if(embeddableClass == null)
return ""; //$NON-NLS-1$
- for (JavaPersistentAttribute relEntAt : embeddableClass.getAttributes()) {
+ for (JavaModifiablePersistentAttribute relEntAt : embeddableClass.getAttributes()) {
IResource r = relEntAt.getParent().getResource();
if (!r.exists())
throw new RuntimeException();
@@ -452,7 +452,7 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
JavaPersistentType jpt = jpaFactory.findJPT(relEntAt, fp, an);
if(jpt == null)
return ""; //$NON-NLS-1$
- for(JavaPersistentAttribute attribute : jpt.getAttributes()){
+ for(JavaModifiablePersistentAttribute attribute : jpt.getAttributes()){
Annotation[] inverseAnns = jpaFactory.getAnnotations(attribute);
for(Annotation inverseAn : inverseAnns){
String inverseAnName = JPAEditorUtil.returnSimpleName(inverseAn.getAnnotationName());
@@ -481,7 +481,7 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
}
- public HasReferanceRelation getEmbeddedRelationToAttribute(JavaPersistentAttribute jpa) {
+ public HasReferanceRelation getEmbeddedRelationToAttribute(JavaModifiablePersistentAttribute jpa) {
String key = produceKeyForRel((JavaPersistentType)jpa.getParent(), jpa.getName());
return attribToEmbeddedRel.get(key);
}
@@ -490,12 +490,12 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
return keyToBO.values();
}
- public void renewAttributeMappingPropListener(JavaPersistentAttribute jpa) {
+ public void renewAttributeMappingPropListener(JavaModifiablePersistentAttribute jpa) {
renewAttributeJoiningStrategyPropertyListener(jpa);
renewAttributeMappingOptPropListener(jpa);
}
- public void renewAttributeJoiningStrategyPropertyListener(JavaPersistentAttribute jpa) {
+ public void renewAttributeJoiningStrategyPropertyListener(JavaModifiablePersistentAttribute jpa) {
AttributeJoiningStrategyPropertyChangeListener lsn = null;
if (attributeJoiningStrategyToPropListener == null)
return;
@@ -525,7 +525,7 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
}
- public void renewAttributeMappingOptPropListener(JavaPersistentAttribute jpa) {
+ public void renewAttributeMappingOptPropListener(JavaModifiablePersistentAttribute jpa) {
AttributeMappingOptionalityChangeListener lsn = null;
WeakReference<AttributeMappingOptionalityChangeListener> ref = attributeMappingOptionalityToPropListener.remove(jpa);
if (ref != null)
@@ -602,14 +602,14 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
}
}
- private void addPropertiesListenerToAttribute(JavaPersistentAttribute jpa) {
+ private void addPropertiesListenerToAttribute(JavaModifiablePersistentAttribute jpa) {
addPropertiesListenerToAttributeItself(jpa);
addPropertiesListenerToJoiningStrategy(jpa);
addPropertiesListenerToRelationshipReference(jpa);
addOptPropListenerToAttributeMapping(jpa);
}
- private void addPropertiesListenerToAttributeItself(JavaPersistentAttribute jpa) {
+ private void addPropertiesListenerToAttributeItself(JavaModifiablePersistentAttribute jpa) {
WeakReference<AttributePropertyChangeListener> lsnrRef = attributeToPropListener.get(jpa);
AttributePropertyChangeListener lsnr = null;
if (lsnrRef != null)
@@ -622,7 +622,7 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
}
}
- private void addOptPropListenerToAttributeMapping(JavaPersistentAttribute jpa) {
+ private void addOptPropListenerToAttributeMapping(JavaModifiablePersistentAttribute jpa) {
WeakReference<AttributeMappingOptionalityChangeListener> lsnrRef = attributeMappingOptionalityToPropListener.get(jpa);
AttributeMappingOptionalityChangeListener lsnr = null;
if (lsnrRef != null)
@@ -642,7 +642,7 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
}
- private void addPropertiesListenerToJoiningStrategy(JavaPersistentAttribute jpa) {
+ private void addPropertiesListenerToJoiningStrategy(JavaModifiablePersistentAttribute jpa) {
WeakReference<AttributeJoiningStrategyPropertyChangeListener> lsnrRef = attributeJoiningStrategyToPropListener.get(jpa);
AttributeJoiningStrategyPropertyChangeListener lsnr = null;
@@ -667,7 +667,7 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
}
- private void addPropertiesListenerToRelationshipReference(JavaPersistentAttribute jpa) {
+ private void addPropertiesListenerToRelationshipReference(JavaModifiablePersistentAttribute jpa) {
WeakReference<AttributeRelationshipReferencePropertyChangeListener> lsnrRef = attributeRelationshipReferenceToPropListener.get(jpa);
AttributeRelationshipReferencePropertyChangeListener lsnr = null;
@@ -711,7 +711,7 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
removeStateListenerFromEntity(jpt);
}
- private void removeListenersFromAttribute(JavaPersistentAttribute jpa) {
+ private void removeListenersFromAttribute(JavaModifiablePersistentAttribute jpa) {
removePropListenerFromAttribute(jpa);
}
@@ -741,14 +741,14 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
}
}
- private void removePropListenerFromAttribute(JavaPersistentAttribute jpa) {
+ private void removePropListenerFromAttribute(JavaModifiablePersistentAttribute jpa) {
removePropListenerFromAttributeItself(jpa);
removePropListenerFromJoiningStrategy(jpa);
removePropListenerFromRelationshipReference(jpa);
removeOptPropListenerFromAttributeMapping(jpa);
}
- private void removePropListenerFromAttributeItself(JavaPersistentAttribute jpa) {
+ private void removePropListenerFromAttributeItself(JavaModifiablePersistentAttribute jpa) {
WeakReference<AttributePropertyChangeListener> lsnrRef = attributeToPropListener.get(jpa);
PropertyChangeListener lsnr = null;
if (lsnrRef != null)
@@ -763,7 +763,7 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
}
}
- private void removePropListenerFromJoiningStrategy(JavaPersistentAttribute jpa) {
+ private void removePropListenerFromJoiningStrategy(JavaModifiablePersistentAttribute jpa) {
WeakReference<AttributeJoiningStrategyPropertyChangeListener> lsnrRef = attributeJoiningStrategyToPropListener.get(jpa);
PropertyChangeListener lsnr = null;
lsnrRef = attributeJoiningStrategyToPropListener.get(jpa);
@@ -789,7 +789,7 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
}
- private void removeOptPropListenerFromAttributeMapping(JavaPersistentAttribute jpa) {
+ private void removeOptPropListenerFromAttributeMapping(JavaModifiablePersistentAttribute jpa) {
WeakReference<AttributeMappingOptionalityChangeListener> lsnrRef = attributeMappingOptionalityToPropListener.get(jpa);
PropertyChangeListener lsnr = null;
lsnrRef = attributeMappingOptionalityToPropListener.get(jpa);
@@ -809,7 +809,7 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
}
- private void removePropListenerFromRelationshipReference(JavaPersistentAttribute jpa) {
+ private void removePropListenerFromRelationshipReference(JavaModifiablePersistentAttribute jpa) {
WeakReference<AttributeRelationshipReferencePropertyChangeListener> lsnrRef = attributeRelationshipReferenceToPropListener.get(jpa);
PropertyChangeListener lsnr = null;
lsnrRef = attributeRelationshipReferenceToPropListener.get(jpa);
@@ -879,13 +879,13 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
}
private void removeAttributePropChangeListeners() {
- Iterator<JavaPersistentAttribute> it = attributeToPropListener.keySet().iterator();
- Set<JavaPersistentAttribute> s = new HashSet<JavaPersistentAttribute>();
+ Iterator<JavaModifiablePersistentAttribute> it = attributeToPropListener.keySet().iterator();
+ Set<JavaModifiablePersistentAttribute> s = new HashSet<JavaModifiablePersistentAttribute>();
while(it.hasNext())
s.add(it.next());
it = s.iterator();
while(it.hasNext()) {
- JavaPersistentAttribute jpa = it.next();
+ JavaModifiablePersistentAttribute jpa = it.next();
WeakReference<AttributePropertyChangeListener> ref = attributeToPropListener.remove(jpa);
PropertyChangeListener lsn = ref.get();
if (lsn != null)
@@ -900,13 +900,13 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
}
private void removeAttributeJoiningStrategyPropChangeListeners() {
- Iterator<JavaPersistentAttribute> it = attributeJoiningStrategyToPropListener.keySet().iterator();
- Set<JavaPersistentAttribute> s = new HashSet<JavaPersistentAttribute>();
+ Iterator<JavaModifiablePersistentAttribute> it = attributeJoiningStrategyToPropListener.keySet().iterator();
+ Set<JavaModifiablePersistentAttribute> s = new HashSet<JavaModifiablePersistentAttribute>();
while(it.hasNext())
s.add(it.next());
it = s.iterator();
while(it.hasNext()) {
- JavaPersistentAttribute jpa = it.next();
+ JavaModifiablePersistentAttribute jpa = it.next();
WeakReference<AttributeJoiningStrategyPropertyChangeListener> ref = attributeJoiningStrategyToPropListener.remove(jpa);
PropertyChangeListener lsn = ref.get();
if (lsn != null)
@@ -921,13 +921,13 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
}
private void removeOptPropListeners() {
- Iterator<JavaPersistentAttribute> it = this.attributeMappingOptionalityToPropListener.keySet().iterator();
- Set<JavaPersistentAttribute> s = new HashSet<JavaPersistentAttribute>();
+ Iterator<JavaModifiablePersistentAttribute> it = this.attributeMappingOptionalityToPropListener.keySet().iterator();
+ Set<JavaModifiablePersistentAttribute> s = new HashSet<JavaModifiablePersistentAttribute>();
while(it.hasNext())
s.add(it.next());
it = s.iterator();
while(it.hasNext()) {
- JavaPersistentAttribute jpa = it.next();
+ JavaModifiablePersistentAttribute jpa = it.next();
WeakReference<AttributeMappingOptionalityChangeListener> ref = attributeMappingOptionalityToPropListener.remove(jpa);
if (ref == null)
continue;
@@ -1184,10 +1184,10 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
synchronized public void propertyChanged(PropertyChangeEvent event) {
Model source = event.getSource();
- if (!JavaPersistentAttribute.class.isInstance(source))
+ if (!JavaModifiablePersistentAttribute.class.isInstance(source))
return;
PictogramElement pe = featureProvider
- .getPictogramElementForBusinessObject(((JavaPersistentAttribute) source)
+ .getPictogramElementForBusinessObject(((JavaModifiablePersistentAttribute) source)
.getParent());
final GraphicalRemoveAttributeFeature remove = new GraphicalRemoveAttributeFeature(featureProvider);
final CustomContext ctx = new CustomContext();
@@ -1200,7 +1200,7 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
Display.getDefault().asyncExec(runnable);
String propName = event.getPropertyName();
if (propName.equals(ModifiablePersistentAttribute.MAPPING_PROPERTY)) {
- renewAttributeMappingPropListener((JavaPersistentAttribute) source);
+ renewAttributeMappingPropListener((JavaModifiablePersistentAttribute) source);
}
}
}
@@ -1223,9 +1223,9 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
if (nd == null)
return;
nd = nd.getParent();
- if ((nd == null) || !JavaPersistentAttribute.class.isInstance(nd))
+ if ((nd == null) || !JavaModifiablePersistentAttribute.class.isInstance(nd))
return;
- JavaPersistentAttribute at = (JavaPersistentAttribute)nd;
+ JavaModifiablePersistentAttribute at = (JavaModifiablePersistentAttribute)nd;
if (!at.getParent().getParent().getResource().exists())
return;
PictogramElement pe = featureProvider.getPictogramElementForBusinessObject(at.getParent());
@@ -1256,9 +1256,9 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
p = p.getParent();
if (p == null)
return;
- if (!JavaPersistentAttribute.class.isInstance(p))
+ if (!JavaModifiablePersistentAttribute.class.isInstance(p))
return;
- JavaPersistentAttribute jpa = (JavaPersistentAttribute)p;
+ JavaModifiablePersistentAttribute jpa = (JavaModifiablePersistentAttribute)p;
renewAttributeJoiningStrategyPropertyListener(jpa);
if (!jpa.getParent().getParent().getResource().exists())
return;
@@ -1287,7 +1287,7 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
Boolean optional = (Boolean)event.getNewValue();
boolean isOptional = (optional == null) ? true : optional.booleanValue();
OptionalMapping nm = (OptionalMapping)event.getSource();
- JavaPersistentAttribute jpa = (JavaPersistentAttribute)nm.getParent();
+ JavaModifiablePersistentAttribute jpa = (JavaModifiablePersistentAttribute)nm.getParent();
IRelation rel = featureProvider.getRelationRelatedToAttribute(jpa);
boolean atBeginning = !rel.getOwner().equals(jpa.getParent()) ||
!rel.getOwnerAttributeName().equals(jpa.getName());
@@ -1331,10 +1331,10 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
@SuppressWarnings("unchecked")
synchronized public void run() {
try {
- Iterator<JavaPersistentAttribute> it = (Iterator<JavaPersistentAttribute>) event.getItems().iterator();
+ Iterator<JavaModifiablePersistentAttribute> it = (Iterator<JavaModifiablePersistentAttribute>) event.getItems().iterator();
Set<Shape> shapesToRemove = new HashSet<Shape>();
while (it.hasNext()) {
- JavaPersistentAttribute at = it.next();
+ JavaModifiablePersistentAttribute at = it.next();
/*
String key = getKeyForBusinessObject(at);
remove(key);
@@ -1347,7 +1347,7 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
JavaPersistentType jpt = (JavaPersistentType)event.getSource();
- JavaPersistentAttribute newAt = jpt.getAttributeNamed(at.getName());
+ JavaModifiablePersistentAttribute newAt = jpt.getAttributeNamed(at.getName());
if (newAt != null) {
RemoveAttributeFeature ft = new RemoveAttributeFeature(featureProvider, true, true);
RemoveContext c = new RemoveContext(atShape);
@@ -1410,9 +1410,9 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver {
ContainerShape entShape = (ContainerShape)featureProvider.getPictogramElementForBusinessObject(jpt);
// remove invalidated relations (if any)
- Iterator<JavaPersistentAttribute> it = (Iterator<JavaPersistentAttribute>) event.getItems().iterator();
+ Iterator<JavaModifiablePersistentAttribute> it = (Iterator<JavaModifiablePersistentAttribute>) event.getItems().iterator();
while (it.hasNext()) {
- JavaPersistentAttribute at = it.next();
+ JavaModifiablePersistentAttribute at = it.next();
if(at.getMapping() == null || at.getMapping().getMappingAnnotation() == null){
at.getResourceAttribute().getJavaResourceCompilationUnit().synchronizeWithJavaSource();
}
diff --git a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JpaArtifactFactory.java b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JpaArtifactFactory.java
index 1724c8297c..623a224064 100644
--- a/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JpaArtifactFactory.java
+++ b/jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JpaArtifactFactory.java
@@ -73,7 +73,7 @@ import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
import org.eclipse.jpt.jpa.core.context.RelationshipMapping;
import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.core.context.java.JavaTypeMapping;
import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
@@ -177,51 +177,51 @@ public class JpaArtifactFactory {
}
public void addOneToOneUnidirectionalRelation(IFeatureProvider fp, JavaPersistentType jpt,
- JavaPersistentAttribute attribute) {
+ JavaModifiablePersistentAttribute attribute) {
addOneToOneRelation(fp, jpt, attribute, null, null,
JPAEditorConstants.RELATION_TYPE_UNIDIRECTIONAL);
}
public void addOneToOneBidirectionalRelation (IFeatureProvider fp, JavaPersistentType jpt1,
- JavaPersistentAttribute attribute1, JavaPersistentType jpt2,
- JavaPersistentAttribute attribute2) {
+ JavaModifiablePersistentAttribute attribute1, JavaPersistentType jpt2,
+ JavaModifiablePersistentAttribute attribute2) {
addOneToOneRelation(fp, jpt1, attribute1, jpt2, attribute2,
JPAEditorConstants.RELATION_TYPE_BIDIRECTIONAL);
}
public void addOneToManyUnidirectionalRelation(IFeatureProvider fp, JavaPersistentType jpt,
- JavaPersistentAttribute attribute, boolean isMap) {
+ JavaModifiablePersistentAttribute attribute, boolean isMap) {
addOneToManyRelation(fp, jpt, attribute, null, null,
JPAEditorConstants.RELATION_TYPE_UNIDIRECTIONAL, isMap);
}
public void addOneToManyBidirectionalRelation(IFeatureProvider fp, JavaPersistentType jpt1,
- JavaPersistentAttribute attribute1, JavaPersistentType jpt2,
- JavaPersistentAttribute attribute2, boolean isMap) {
+ JavaModifiablePersistentAttribute attribute1, JavaPersistentType jpt2,
+ JavaModifiablePersistentAttribute attribute2, boolean isMap) {
addOneToManyRelation(fp, jpt1, attribute1, jpt2, attribute2,
JPAEditorConstants.RELATION_TYPE_BIDIRECTIONAL, isMap);
}
public void addManyToOneBidirectionalRelation(IFeatureProvider fp, JavaPersistentType jpt1,
- JavaPersistentAttribute attribute1, JavaPersistentType jpt2,
- JavaPersistentAttribute attribute2, boolean isMap) {
+ JavaModifiablePersistentAttribute attribute1, JavaPersistentType jpt2,
+ JavaModifiablePersistentAttribute attribute2, boolean isMap) {
addManyToOneRelation(fp, jpt1, attribute1, jpt2, attribute2,
JPAEditorConstants.RELATION_TYPE_BIDIRECTIONAL, isMap);
}
public void addOneToOneRelation(IFeatureProvider fp,
- JavaPersistentType ownerJPT, JavaPersistentAttribute ownerAttibute,
+ JavaPersistentType ownerJPT, JavaModifiablePersistentAttribute ownerAttibute,
JavaPersistentType referencedJPT,
- JavaPersistentAttribute referencedAttribute, int direction) {
+ JavaModifiablePersistentAttribute referencedAttribute, int direction) {
setMappingKeyToAttribute(fp, ownerJPT, ownerAttibute, MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
if (direction == JPAEditorConstants.RELATION_TYPE_BIDIRECTIONAL) {
- JavaPersistentAttribute resolvedAttribute = setMappingKeyToAttribute(fp, referencedJPT, referencedAttribute, MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
+ JavaModifiablePersistentAttribute resolvedAttribute = setMappingKeyToAttribute(fp, referencedJPT, referencedAttribute, MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
String mappedByAttr = getMappeByAttribute(fp, ownerJPT, ownerAttibute);
setMappedByAnnotationAttribute(resolvedAttribute, referencedJPT, mappedByAttr);
}
@@ -229,15 +229,15 @@ public class JpaArtifactFactory {
}
public void addManyToOneRelation(IFeatureProvider fp, JavaPersistentType manySideJPT,
- JavaPersistentAttribute manySideAttribute, JavaPersistentType singleSideJPT,
- JavaPersistentAttribute singleSideAttibute, int direction, boolean isMap) {
+ JavaModifiablePersistentAttribute manySideAttribute, JavaPersistentType singleSideJPT,
+ JavaModifiablePersistentAttribute singleSideAttibute, int direction, boolean isMap) {
setMappingKeyToAttribute(fp, manySideJPT, manySideAttribute, MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
if (direction == JPAEditorConstants.RELATION_TYPE_UNIDIRECTIONAL)
return;
- JavaPersistentAttribute resolvedSingleSideAttribute = setMappingKeyToAttribute(fp, singleSideJPT, singleSideAttibute, MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
+ JavaModifiablePersistentAttribute resolvedSingleSideAttribute = setMappingKeyToAttribute(fp, singleSideJPT, singleSideAttibute, MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
String mappedByAttr = getMappeByAttribute(fp, manySideJPT, manySideAttribute);
setMappedByAnnotationAttribute(resolvedSingleSideAttribute, singleSideJPT, mappedByAttr);
if (isMap) {
@@ -247,11 +247,11 @@ public class JpaArtifactFactory {
}
public void addOneToManyRelation(IFeatureProvider fp, JavaPersistentType singleSideJPT,
- JavaPersistentAttribute singleSideAttibute,
+ JavaModifiablePersistentAttribute singleSideAttibute,
JavaPersistentType manySideJPT,
- JavaPersistentAttribute manySideAttribute, int direction, boolean isMap) {
+ JavaModifiablePersistentAttribute manySideAttribute, int direction, boolean isMap) {
- JavaPersistentAttribute resolvedSingleSideAttribute = setMappingKeyToAttribute(fp, singleSideJPT, singleSideAttibute, MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
+ JavaModifiablePersistentAttribute resolvedSingleSideAttribute = setMappingKeyToAttribute(fp, singleSideJPT, singleSideAttibute, MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
if (direction == JPAEditorConstants.RELATION_TYPE_BIDIRECTIONAL) {
setMappingKeyToAttribute(fp, manySideJPT, manySideAttribute, MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
@@ -265,21 +265,21 @@ public class JpaArtifactFactory {
}
private String getMappeByAttribute(IFeatureProvider fp,
- JavaPersistentType ownerSideJPT, JavaPersistentAttribute ownerSideAttribute) {
+ JavaPersistentType ownerSideJPT, JavaModifiablePersistentAttribute ownerSideAttribute) {
String mappedByAttr = ownerSideAttribute.getName();
if(hasEmbeddableAnnotation(ownerSideJPT)){
HasReferanceRelation ref = JpaArtifactFactory.INSTANCE.findFisrtHasReferenceRelationByEmbeddable(ownerSideJPT, (IJPAEditorFeatureProvider)fp);
if(ref != null){
- JavaPersistentAttribute embeddingAttribute = ref.getEmbeddedAnnotatedAttribute();
+ JavaModifiablePersistentAttribute embeddingAttribute = ref.getEmbeddedAnnotatedAttribute();
mappedByAttr = embeddingAttribute.getName() + "." + ownerSideAttribute.getName(); //$NON-NLS-1$
}
}
return mappedByAttr;
}
- private void setMappedByAnnotationAttribute(JavaPersistentAttribute resolvedAttr, JavaPersistentType type1, String jpaName){
+ private void setMappedByAnnotationAttribute(JavaModifiablePersistentAttribute resolvedAttr, JavaPersistentType type1, String jpaName){
JavaAttributeMapping mapping = resolvedAttr.getMapping();
if (!(mapping instanceof RelationshipMapping)) {
@@ -295,20 +295,20 @@ public class JpaArtifactFactory {
((OwnableRelationshipMappingAnnotation)annotation).setMappedBy(jpaName);
}
- private JavaPersistentAttribute setMappingKeyToAttribute(IFeatureProvider fp, JavaPersistentType jpt, JavaPersistentAttribute jpa, String mappingKey){
- JavaPersistentAttribute resolvedManySideAttribute = (JavaPersistentAttribute) jpt.resolveAttribute(jpa.getName());
+ private JavaModifiablePersistentAttribute setMappingKeyToAttribute(IFeatureProvider fp, JavaPersistentType jpt, JavaModifiablePersistentAttribute jpa, String mappingKey){
+ JavaModifiablePersistentAttribute resolvedManySideAttribute = (JavaModifiablePersistentAttribute) jpt.resolveAttribute(jpa.getName());
resolvedManySideAttribute.setMappingKey(mappingKey);
return resolvedManySideAttribute;
}
- private void addJoinColumnIfNecessary(JavaPersistentAttribute jpa,
+ private void addJoinColumnIfNecessary(JavaModifiablePersistentAttribute jpa,
JavaPersistentType jpt) {
if (JPAEditorUtil.checkJPAFacetVersion(jpa.getJpaProject(), JPAEditorUtil.JPA_PROJECT_FACET_10) ||
JPADiagramPropertyPage.shouldOneToManyUnidirBeOldStyle(jpa
.getJpaProject().getProject()))
return;
- JavaPersistentAttribute[] ids = getIds(jpt);
+ JavaModifiablePersistentAttribute[] ids = getIds(jpt);
if (ids.length == 0)
return;
final String tableName = getTableName(jpt);
@@ -327,7 +327,7 @@ public class JpaArtifactFactory {
Embeddable emb = pu.getEmbeddable(embeddableTypeName);
for (AttributeMapping am : emb.getAllAttributeMappings()) {
JoinColumnAnnotation jc = (JoinColumnAnnotation) jpa.getResourceAttribute().addAnnotation(jpa.getResourceAttribute().getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME), JoinColumnAnnotation.ANNOTATION_NAME);
- JavaPersistentAttribute at = (JavaPersistentAttribute) am
+ JavaModifiablePersistentAttribute at = (JavaModifiablePersistentAttribute) am
.getPersistentAttribute();
String idColName = atNameToColName.get(at.getName());
idColName = (idColName != null) ? idColName
@@ -337,7 +337,7 @@ public class JpaArtifactFactory {
}
}
} else {
- for (JavaPersistentAttribute idAt : ids) {
+ for (JavaModifiablePersistentAttribute idAt : ids) {
JoinColumnAnnotation jc = (JoinColumnAnnotation) jpa.getResourceAttribute().addAnnotation( jpa.getResourceAttribute().getAnnotationsSize(JoinColumnAnnotation.ANNOTATION_NAME), JoinColumnAnnotation.ANNOTATION_NAME);
String idColName = getColumnName(idAt);
jc.setName(tableName + "_" + idColName); //$NON-NLS-1$
@@ -347,7 +347,7 @@ public class JpaArtifactFactory {
}
private Hashtable<String, String> getOverriddenColNames(
- JavaPersistentAttribute embIdAt) {
+ JavaModifiablePersistentAttribute embIdAt) {
Hashtable<String, String> res = new Hashtable<String, String>();
if(embIdAt.getResourceAttribute().getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME) > 0){
AttributeOverrideAnnotation aon = (AttributeOverrideAnnotation) embIdAt
@@ -380,7 +380,7 @@ public class JpaArtifactFactory {
public void addManyToOneUnidirectionalRelation(IFeatureProvider fp, JavaPersistentType jpt,
- JavaPersistentAttribute attribute) {
+ JavaModifiablePersistentAttribute attribute) {
addManyToOneRelation(fp, jpt, attribute, null, null,
JPAEditorConstants.RELATION_TYPE_UNIDIRECTIONAL, false);
@@ -388,31 +388,31 @@ public class JpaArtifactFactory {
public void addManyToManyBidirectionalRelation(IFeatureProvider fp, JavaPersistentType jpt1,
- JavaPersistentAttribute attribute1, JavaPersistentType jpt2,
- JavaPersistentAttribute attribute2, boolean isMap) {
+ JavaModifiablePersistentAttribute attribute1, JavaPersistentType jpt2,
+ JavaModifiablePersistentAttribute attribute2, boolean isMap) {
addManyToManyRelation(fp, jpt1, attribute1, jpt2, attribute2,
JPAEditorConstants.RELATION_TYPE_BIDIRECTIONAL, isMap);
}
public void addManyToManyUnidirectionalRelation(IFeatureProvider fp, JavaPersistentType annotatedJPT,
- JavaPersistentAttribute annotatedAttribute, boolean isMap) {
+ JavaModifiablePersistentAttribute annotatedAttribute, boolean isMap) {
addManyToManyRelation(fp, annotatedJPT, annotatedAttribute, null, null,
JPAEditorConstants.RELATION_TYPE_UNIDIRECTIONAL, isMap);
}
public void addManyToManyRelation(IFeatureProvider fp, JavaPersistentType ownerSideJPT,
- JavaPersistentAttribute ownerSideAttribute,
+ JavaModifiablePersistentAttribute ownerSideAttribute,
JavaPersistentType inverseSideJPT,
- JavaPersistentAttribute inverseSideAttibute, int direction, boolean isMap) {
+ JavaModifiablePersistentAttribute inverseSideAttibute, int direction, boolean isMap) {
- JavaPersistentAttribute resolvedOwnerSideAttribute = setMappingKeyToAttribute(fp, ownerSideJPT, ownerSideAttribute, MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
+ JavaModifiablePersistentAttribute resolvedOwnerSideAttribute = setMappingKeyToAttribute(fp, ownerSideJPT, ownerSideAttribute, MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
if (isMap)
resolvedOwnerSideAttribute.getResourceAttribute().addAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
if (direction == JPAEditorConstants.RELATION_TYPE_BIDIRECTIONAL) {
- JavaPersistentAttribute resolvedInverseSideAttribute = setMappingKeyToAttribute(fp, inverseSideJPT, inverseSideAttibute, MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
+ JavaModifiablePersistentAttribute resolvedInverseSideAttribute = setMappingKeyToAttribute(fp, inverseSideJPT, inverseSideAttibute, MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
String mappedByAttr = getMappeByAttribute(fp, ownerSideJPT, ownerSideAttribute);
setMappedByAnnotationAttribute(resolvedInverseSideAttribute, inverseSideJPT, mappedByAttr);
@@ -612,7 +612,7 @@ public class JpaArtifactFactory {
PersistenceUnit pu = lit.next();
for(PersistentType jpt : pu.getPersistentTypes()){
if(!jpt.equals(embeddable)){
- for(JavaPersistentAttribute jpa : ((JavaPersistentType)jpt).getAttributes()){
+ for(JavaModifiablePersistentAttribute jpa : ((JavaPersistentType)jpt).getAttributes()){
if(isEmbeddedId(jpa) && JPAEditorUtil.getAttributeTypeNameWithGenerics(jpa).equals(embeddable.getName())){
embeddingEntities.add((JavaPersistentType) jpt);
}
@@ -664,19 +664,19 @@ public class JpaArtifactFactory {
* @param cu - the {@link ICompilationUnit} of the referencing {@link JavaPersistentType}
* @return the newly created relationship attribute.
*/
- public JavaPersistentAttribute addAttribute(IJPAEditorFeatureProvider fp, JavaPersistentType jpt,
+ public JavaModifiablePersistentAttribute addAttribute(IJPAEditorFeatureProvider fp, JavaPersistentType jpt,
JavaPersistentType attributeType, String mapKeyType, String attributeName,
String actName, boolean isCollection, ICompilationUnit cu) {
try {
if (doesAttributeExist(jpt, actName)) {
- return (JavaPersistentAttribute) jpt.resolveAttribute(attributeName);
+ return (JavaModifiablePersistentAttribute) jpt.resolveAttribute(attributeName);
}
} catch (JavaModelException e) {
JPADiagramEditorPlugin.logError("Cannnot create a new attribute with name " + attributeName, e); //$NON-NLS-1$
}
- JavaPersistentAttribute res = makeNewAttribute(fp, jpt, cu, attributeName, attributeType.getName(), actName, mapKeyType, null, null, isCollection);
+ JavaModifiablePersistentAttribute res = makeNewAttribute(fp, jpt, cu, attributeName, attributeType.getName(), actName, mapKeyType, null, null, isCollection);
return res;
}
@@ -762,7 +762,7 @@ public class JpaArtifactFactory {
return newAttrName;
}
- public JavaPersistentAttribute makeNewAttribute(IJPAEditorFeatureProvider fp, JavaPersistentType jpt, ICompilationUnit cu, String attrName, String attrTypeName,
+ public JavaModifiablePersistentAttribute makeNewAttribute(IJPAEditorFeatureProvider fp, JavaPersistentType jpt, ICompilationUnit cu, String attrName, String attrTypeName,
String actName, String mapKeyType, String[] attrTypes, List<String> annotations, boolean isCollection) {
if(cu == null){
@@ -776,7 +776,7 @@ public class JpaArtifactFactory {
JPADiagramEditorPlugin.logError("Cannot create a new attribute with name " + attrName, e); //$NON-NLS-1$
}
- JavaPersistentAttribute jpa = jpt.getAttributeNamed(attrName);
+ JavaModifiablePersistentAttribute jpa = jpt.getAttributeNamed(attrName);
if(jpa == null){
jpa = jpt.getAttributeNamed(actName);
}
@@ -854,7 +854,7 @@ public class JpaArtifactFactory {
* @param persistentAttribite
* @return an array of all current annotations of the given attribute.
*/
- public Annotation[] getAnnotations(JavaPersistentAttribute persistentAttribite) {
+ public Annotation[] getAnnotations(JavaModifiablePersistentAttribute persistentAttribite) {
JavaResourceAttribute jrpt = persistentAttribite.getResourceAttribute();
Annotation[] res = new Annotation[jrpt.getAnnotationsSize()];
int c = 0;
@@ -870,7 +870,7 @@ public class JpaArtifactFactory {
* @param persistentAttribite
* @return a set of strings of all current annotation names of the given attribute.
*/
- public HashSet<String> getAnnotationNames(JavaPersistentAttribute persistentAttribite) {
+ public HashSet<String> getAnnotationNames(JavaModifiablePersistentAttribute persistentAttribite) {
HashSet<String> res = new HashSet<String>();
if(persistentAttribite != null) {
JavaResourceAttribute jrpt = persistentAttribite.getResourceAttribute();
@@ -887,7 +887,7 @@ public class JpaArtifactFactory {
* @return a list of strings of all current annotation names of the given attribute.
*/
public List<String> getAnnotationStrings(
- JavaPersistentAttribute persistentAttribite) {
+ JavaModifiablePersistentAttribute persistentAttribite) {
JavaPersistentType jpt = (JavaPersistentType)persistentAttribite.getParent();
CompilationUnit jdtCU = jpt.getJavaResourceType().getJavaResourceCompilationUnit().buildASTRoot();
@@ -905,7 +905,7 @@ public class JpaArtifactFactory {
* @param at
* @return true, if the attribute is owner of the relationship, false otherwise.
*/
- private boolean isNonOwner(JavaPersistentAttribute at) {
+ private boolean isNonOwner(JavaModifiablePersistentAttribute at) {
JavaAttributeMapping jam = at.getMapping();
if (!(jam.getMappingAnnotation() instanceof OwnableRelationshipMappingAnnotation))
return false;
@@ -988,7 +988,7 @@ public class JpaArtifactFactory {
Collection<HasReferanceRelation> resSet = new HashSet<HasReferanceRelation>();
HasReferanceRelation res = null;
- for (JavaPersistentAttribute embeddingAttribute : embeddingEntity.getAttributes()) {
+ for (JavaModifiablePersistentAttribute embeddingAttribute : embeddingEntity.getAttributes()) {
IResource r = embeddingAttribute.getParent().getResource();
if (!r.exists())
throw new RuntimeException();
@@ -1030,7 +1030,7 @@ public class JpaArtifactFactory {
* @param fp
* @return the newly created relationship.
*/
- public IRelation produceIRelation(JavaPersistentAttribute persistentAttribite, JavaPersistentType jpt2,
+ public IRelation produceIRelation(JavaModifiablePersistentAttribute persistentAttribite, JavaPersistentType jpt2,
IJPAEditorFeatureProvider fp) {
IRelation res = null;
@@ -1062,7 +1062,7 @@ public class JpaArtifactFactory {
* @param an - attribute's relationship annotation
* @return the parent {@link JavaPersistentType} of an attribute.
*/
- public JavaPersistentType findJPT(JavaPersistentAttribute persistentAttribite, IJPAEditorFeatureProvider fp, Annotation an) {
+ public JavaPersistentType findJPT(JavaModifiablePersistentAttribute persistentAttribite, IJPAEditorFeatureProvider fp, Annotation an) {
JavaResourceAttribute jrpa = persistentAttribite.getResourceAttribute();
String relTypeName = getRelTypeName(an, jrpa);
JavaPersistentType relJPT = (JavaPersistentType)fp.getBusinessObjectForKey(relTypeName);
@@ -1073,7 +1073,7 @@ public class JpaArtifactFactory {
JavaPersistentType newJPT, JavaPersistentType jpt2, IJPAEditorFeatureProvider fp) {
Set<IRelation> res = new HashSet<IRelation>();
- for (JavaPersistentAttribute at : newJPT.getAttributes()) {
+ for (JavaModifiablePersistentAttribute at : newJPT.getAttributes()) {
IRelation rel = produceIRelation(at, jpt2, fp);
if (rel != null)
res.add(rel);
@@ -1109,8 +1109,8 @@ public class JpaArtifactFactory {
* @param jpt
* @return a set of all attributes of an entity involved in relationship with the given entity.
*/
- public Set<JavaPersistentAttribute> getRelatedAttributes(JavaPersistentType jpt) {
- Set<JavaPersistentAttribute> res = new HashSet<JavaPersistentAttribute>();
+ public Set<JavaModifiablePersistentAttribute> getRelatedAttributes(JavaPersistentType jpt) {
+ Set<JavaModifiablePersistentAttribute> res = new HashSet<JavaModifiablePersistentAttribute>();
Iterator<JpaFile> it = jpt.getJpaProject().getJpaFiles().iterator();
PersistenceUnit pu = JpaArtifactFactory.INSTANCE.getPersistenceUnit(jpt.getJpaProject());
while (it.hasNext()) {
@@ -1130,7 +1130,7 @@ public class JpaArtifactFactory {
.getPersistentType(name);
if (jpt1 == null)
continue;
- Set<JavaPersistentAttribute> relAts = getRelAttributes(jpt, jpt1);
+ Set<JavaModifiablePersistentAttribute> relAts = getRelAttributes(jpt, jpt1);
if (relAts != null)
res.addAll(relAts);
}
@@ -1143,11 +1143,11 @@ public class JpaArtifactFactory {
* @param relJPT
* @return the attribute belonging to jpt and involved in a relationship with relJPT.
*/
- private Set<JavaPersistentAttribute> getRelAttributes(JavaPersistentType jpt,
+ private Set<JavaModifiablePersistentAttribute> getRelAttributes(JavaPersistentType jpt,
JavaPersistentType relJPT) {
- Set<JavaPersistentAttribute> res = new HashSet<JavaPersistentAttribute>();
- for (JavaPersistentAttribute at : relJPT.getAttributes()) {
+ Set<JavaModifiablePersistentAttribute> res = new HashSet<JavaModifiablePersistentAttribute>();
+ for (JavaModifiablePersistentAttribute at : relJPT.getAttributes()) {
IResource r = at.getParent().getResource();
if (!r.exists())
throw new RuntimeException();
@@ -1178,7 +1178,7 @@ public class JpaArtifactFactory {
}
}
- public JavaPersistentAttribute renameAttribute(JavaPersistentType jpt,
+ public JavaModifiablePersistentAttribute renameAttribute(JavaPersistentType jpt,
String oldName, String newName, String inverseEntityName,
IJPAEditorFeatureProvider fp) throws InterruptedException {
newName = JPAEditorUtil.decapitalizeFirstLetter(newName);
@@ -1187,7 +1187,7 @@ public class JpaArtifactFactory {
}
newName = JPAEditorUtil.produceUniqueAttributeName(jpt, newName);
PersistenceUnit pu = null;
- JavaPersistentAttribute oldAt = jpt.getAttributeNamed(oldName);
+ JavaModifiablePersistentAttribute oldAt = jpt.getAttributeNamed(oldName);
fp.addAddIgnore((JavaPersistentType)oldAt.getParent(), newName);
JavaResourceAttribute jra = oldAt
.getResourceAttribute();
@@ -1196,7 +1196,7 @@ public class JpaArtifactFactory {
Command renameAttributeCommand = new RenameAttributeCommand(null, jpt, oldName, newName, fp);
getJpaProjectManager().execute(renameAttributeCommand, SynchronousUiCommandExecutor.instance());
- JavaPersistentAttribute newAt = jpt.getAttributeNamed(newName);
+ JavaModifiablePersistentAttribute newAt = jpt.getAttributeNamed(newName);
if (newAt == null) {
JPADiagramEditorPlugin.logError("The attribute " + newName + " could not be resolved", new NullPointerException()); //$NON-NLS-1$ //$NON-NLS-2$
}
@@ -1216,8 +1216,8 @@ public class JpaArtifactFactory {
private void updateIRelationshipAttributes(JavaPersistentType jpt,
String inverseEntityName, IJPAEditorFeatureProvider fp,
- PersistenceUnit pu, JavaPersistentAttribute oldAt,
- JavaPersistentAttribute newAt) throws InterruptedException {
+ PersistenceUnit pu, JavaModifiablePersistentAttribute oldAt,
+ JavaModifiablePersistentAttribute newAt) throws InterruptedException {
IRelation rel = fp.getRelationRelatedToAttribute(oldAt);
String inverseAttributeName = null;
JavaPersistentType inverseJPT = null;
@@ -1253,11 +1253,11 @@ public class JpaArtifactFactory {
}
- private void renameMapsIdAnnotationValue(JavaPersistentAttribute oldAt,
- JavaPersistentAttribute newAt, HashSet<JavaPersistentType> embeddingEntities) {
+ private void renameMapsIdAnnotationValue(JavaModifiablePersistentAttribute oldAt,
+ JavaModifiablePersistentAttribute newAt, HashSet<JavaPersistentType> embeddingEntities) {
for(JavaPersistentType embeddingEntity : embeddingEntities){
- for(JavaPersistentAttribute attr : embeddingEntity.getAttributes()){
+ for(JavaModifiablePersistentAttribute attr : embeddingEntity.getAttributes()){
Annotation ann = attr.getResourceAttribute().getAnnotation(MapsId2_0Annotation.ANNOTATION_NAME);
if(ann != null){
MapsId2_0Annotation mapsIdAnn = (MapsId2_0Annotation) ann;
@@ -1294,16 +1294,16 @@ public class JpaArtifactFactory {
* @param fp
* @return the newly created {@link IRelation}
*/
- private IRelation produceRelation(JavaPersistentAttribute persistentAttribite, Annotation an,
+ private IRelation produceRelation(JavaModifiablePersistentAttribute persistentAttribite, Annotation an,
JavaPersistentType relJPT, IJPAEditorFeatureProvider fp) {
- Hashtable<JavaPersistentAttribute, Annotation> ht = getRelAttributeAnnotation(
+ Hashtable<JavaModifiablePersistentAttribute, Annotation> ht = getRelAttributeAnnotation(
persistentAttribite, relJPT, fp);
if (ht == null) {
return produceUniDirRelation((JavaPersistentType)persistentAttribite
.getParent(), persistentAttribite, an, relJPT, fp);
} else {
- JavaPersistentAttribute relAt = ht.keys().nextElement();
+ JavaModifiablePersistentAttribute relAt = ht.keys().nextElement();
Annotation relAn = ht.get(relAt);
return produceBiDirRelation((JavaPersistentType)persistentAttribite
.getParent(), persistentAttribite, an, relJPT,
@@ -1320,7 +1320,7 @@ public class JpaArtifactFactory {
* @param fp
* @return the newly created {@link HasReferanceRelation}.
*/
- private HasReferanceRelation produceEmbeddedRelation(JavaPersistentAttribute embeddingAttribute, Annotation an,
+ private HasReferanceRelation produceEmbeddedRelation(JavaModifiablePersistentAttribute embeddingAttribute, Annotation an,
JavaPersistentType embeddable, IJPAEditorFeatureProvider fp) {
if (!JPAEditorUtil.getCompilationUnit((JavaPersistentType) embeddingAttribute.getParent()).exists())
@@ -1353,11 +1353,11 @@ public class JpaArtifactFactory {
* @param fp
* @return a {@link Hashtable} containing the pair: inverseAttribute <-> relation annotation.
*/
- private Hashtable<JavaPersistentAttribute, Annotation> getRelAttributeAnnotation(
- JavaPersistentAttribute jpa, JavaPersistentType relJPT, IJPAEditorFeatureProvider fp) {
+ private Hashtable<JavaModifiablePersistentAttribute, Annotation> getRelAttributeAnnotation(
+ JavaModifiablePersistentAttribute jpa, JavaPersistentType relJPT, IJPAEditorFeatureProvider fp) {
JavaPersistentType jpt = (JavaPersistentType)jpa.getParent();
- for (JavaPersistentAttribute relEntAt : relJPT.getAttributes()) {
+ for (JavaModifiablePersistentAttribute relEntAt : relJPT.getAttributes()) {
IResource r = relEntAt.getParent().getResource();
if (!r.exists())
throw new RuntimeException();
@@ -1389,7 +1389,7 @@ public class JpaArtifactFactory {
String relTypeName = getRelTypeName(an, relJRA);
if (!relTypeName.equals(jpt.getName()))
continue;
- Hashtable<JavaPersistentAttribute, Annotation> ht = new Hashtable<JavaPersistentAttribute, Annotation>();
+ Hashtable<JavaModifiablePersistentAttribute, Annotation> ht = new Hashtable<JavaModifiablePersistentAttribute, Annotation>();
ht.put(relEntAt, an);
return ht;
}
@@ -1412,10 +1412,10 @@ public class JpaArtifactFactory {
* @return the entity involved in the bidirectional relationship between the embeddable class and some entity.
*/
private JavaPersistentType getInvolvedEntity(IJPAEditorFeatureProvider fp, JavaPersistentType jpt,
- JavaPersistentAttribute relEntAt, Annotation an, String[] mappedByStrings) {
+ JavaModifiablePersistentAttribute relEntAt, Annotation an, String[] mappedByStrings) {
String mappedBy = mappedByStrings[0];
JavaPersistentType involvedEntity = findJPT(relEntAt, fp, an);
- JavaPersistentAttribute embeddedAttribute = involvedEntity.getAttributeNamed(mappedBy);
+ JavaModifiablePersistentAttribute embeddedAttribute = involvedEntity.getAttributeNamed(mappedBy);
if(embeddedAttribute != null){
JavaPersistentType embeddedJPT = findJPT(embeddedAttribute, fp, getAnnotations(embeddedAttribute)[0]);
if(embeddedJPT.equals(jpt)) {
@@ -1435,7 +1435,7 @@ public class JpaArtifactFactory {
* @return the newly created unidirectional relationship.
*/
private IUnidirectionalRelation produceUniDirRelation(
- JavaPersistentType jpt, JavaPersistentAttribute at, Annotation an,
+ JavaPersistentType jpt, JavaModifiablePersistentAttribute at, Annotation an,
JavaPersistentType relJPT, IJPAEditorFeatureProvider fp) {
if (isNonOwner(at) || !JPAEditorUtil.getCompilationUnit((JavaPersistentType) at.getParent()).exists())
@@ -1448,7 +1448,7 @@ public class JpaArtifactFactory {
}
private IUnidirectionalRelation createUniDirRelationshipDependsOnTheType(
- JavaPersistentType jpt, JavaPersistentAttribute at,
+ JavaPersistentType jpt, JavaModifiablePersistentAttribute at,
JavaPersistentType relJPT, IJPAEditorFeatureProvider fp,
String annotationName) {
IUnidirectionalRelation res = null;
@@ -1488,8 +1488,8 @@ public class JpaArtifactFactory {
* @return the newly created bidirectional relationship.
*/
private IBidirectionalRelation produceBiDirRelation(JavaPersistentType jpt,
- JavaPersistentAttribute at, Annotation an,
- JavaPersistentType relJPT, JavaPersistentAttribute relAt,
+ JavaModifiablePersistentAttribute at, Annotation an,
+ JavaPersistentType relJPT, JavaModifiablePersistentAttribute relAt,
Annotation relAn, IJPAEditorFeatureProvider fp) {
String annotationName = JPAEditorUtil.returnSimpleName(an.getAnnotationName());
String relAnnotationName = JPAEditorUtil.returnSimpleName(relAn.getAnnotationName());
@@ -1615,12 +1615,12 @@ public class JpaArtifactFactory {
return jpt.getPersistenceUnit();
}
- public boolean isMethodAnnotated(JavaPersistentAttribute attr) {
+ public boolean isMethodAnnotated(JavaModifiablePersistentAttribute attr) {
return attr.getResourceAttribute().getAstNodeType() == AstNodeType.METHOD;
}
public boolean isMethodAnnotated(JavaPersistentType jpt) {
- ListIterator<JavaPersistentAttribute> li = jpt.getAttributes().iterator();
+ ListIterator<JavaModifiablePersistentAttribute> li = jpt.getAttributes().iterator();
if (!li.hasNext())
return false;
return (isMethodAnnotated(li.next()));
@@ -1789,7 +1789,7 @@ public class JpaArtifactFactory {
IdClassAnnotation an = (IdClassAnnotation)jpt.getJavaResourceType().getAnnotation(IdClassAnnotation.ANNOTATION_NAME);
if (an != null)
return an.getFullyQualifiedClassName();
- JavaPersistentAttribute[] ids = getIds(jpt);
+ JavaModifiablePersistentAttribute[] ids = getIds(jpt);
if (ids.length == 0)
return null;
String type = ids[0].getTypeName();
@@ -1797,14 +1797,14 @@ public class JpaArtifactFactory {
return (wrapper != null) ? wrapper : type;
}
- public JavaPersistentAttribute[] getIds(JavaPersistentType jpt) {
- ArrayList<JavaPersistentAttribute> res = new ArrayList<JavaPersistentAttribute>();
- for (JavaPersistentAttribute at : jpt.getAttributes()) {
+ public JavaModifiablePersistentAttribute[] getIds(JavaPersistentType jpt) {
+ ArrayList<JavaModifiablePersistentAttribute> res = new ArrayList<JavaModifiablePersistentAttribute>();
+ for (JavaModifiablePersistentAttribute at : jpt.getAttributes()) {
if (isId(at)) {
res.add(at);
}
}
- JavaPersistentAttribute[] ret = new JavaPersistentAttribute[res.size()];
+ JavaModifiablePersistentAttribute[] ret = new JavaModifiablePersistentAttribute[res.size()];
return res.toArray(ret);
}
@@ -1821,13 +1821,13 @@ public class JpaArtifactFactory {
}
public boolean hasPrimaryKey(JavaPersistentType jpt) {
- for (JavaPersistentAttribute at : jpt.getAttributes())
+ for (JavaModifiablePersistentAttribute at : jpt.getAttributes())
if (isId(at)) return true;
return false;
}
private boolean hasSimplePk(JavaPersistentType jpt) {
- for(JavaPersistentAttribute at : jpt.getAttributes()){
+ for(JavaModifiablePersistentAttribute at : jpt.getAttributes()){
if(isSimpleId(at) && !hasIDClassAnnotation(jpt)){
return true;
}
@@ -1835,8 +1835,8 @@ public class JpaArtifactFactory {
return false;
}
- private JavaPersistentAttribute getSimplePkAttribute(JavaPersistentType jpt){
- for(JavaPersistentAttribute jpa : jpt.getAttributes()){
+ private JavaModifiablePersistentAttribute getSimplePkAttribute(JavaPersistentType jpt){
+ for(JavaModifiablePersistentAttribute jpa : jpt.getAttributes()){
if(isSimpleId(jpa)){
return jpa;
}
@@ -1853,7 +1853,7 @@ public class JpaArtifactFactory {
}
private boolean hasEmbeddedPk(JavaPersistentType jpt){
- for(JavaPersistentAttribute at : jpt.getAttributes()){
+ for(JavaModifiablePersistentAttribute at : jpt.getAttributes()){
if(isEmbeddedId(at)){
return true;
}
@@ -1861,8 +1861,8 @@ public class JpaArtifactFactory {
return false;
}
- private JavaPersistentAttribute getEmbeddedIdAttribute(JavaPersistentType jpt){
- for(JavaPersistentAttribute jpa : jpt.getAttributes()){
+ private JavaModifiablePersistentAttribute getEmbeddedIdAttribute(JavaPersistentType jpt){
+ for(JavaModifiablePersistentAttribute jpa : jpt.getAttributes()){
if(isEmbeddedId(jpa)){
return jpa;
}
@@ -1874,11 +1874,11 @@ public class JpaArtifactFactory {
return (jpa.getMappingKey() == MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
}
- public boolean isEmbeddedAttribute(JavaPersistentAttribute jpa) {
+ public boolean isEmbeddedAttribute(JavaModifiablePersistentAttribute jpa) {
return (jpa.getMappingKey() == MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
}
- public String getColumnName(JavaPersistentAttribute jpa) {
+ public String getColumnName(JavaModifiablePersistentAttribute jpa) {
String columnName= null;
ColumnAnnotation an = (ColumnAnnotation)jpa.
getResourceAttribute().
@@ -1987,10 +1987,10 @@ public class JpaArtifactFactory {
* @param inverseJPT - the parent entity (the relationship's inverse/target entity)
* @param ownerAttr - the relationship's owner attribute
*/
- public void calculateDerivedIdAnnotation(JavaPersistentType ownerJPT, JavaPersistentType inverseJPT, JavaPersistentAttribute ownerAttr) {
+ public void calculateDerivedIdAnnotation(JavaPersistentType ownerJPT, JavaPersistentType inverseJPT, JavaModifiablePersistentAttribute ownerAttr) {
String attributeType = null;
if(hasSimplePk(inverseJPT)){
- JavaPersistentAttribute jpa = getSimplePkAttribute(inverseJPT);
+ JavaModifiablePersistentAttribute jpa = getSimplePkAttribute(inverseJPT);
attributeType = JPAEditorUtil.getAttributeTypeNameWithGenerics(jpa);
} else {
if(hasIDClassAnnotation(inverseJPT)){
@@ -2011,7 +2011,7 @@ public class JpaArtifactFactory {
* @param inverseIdClassFQN - he type of the primary key of the parent entity
*/
private void addAppropriateDerivedIdAnnotation(JavaPersistentType ownerJPT,
- JavaPersistentType inverseJPT, JavaPersistentAttribute ownerAttr,
+ JavaPersistentType inverseJPT, JavaModifiablePersistentAttribute ownerAttr,
String inverseIdClassFQN) {
if(hasIDClassAnnotation(ownerJPT)){
String ownerIdClassFQN = getIdType(ownerJPT);
@@ -2039,7 +2039,7 @@ public class JpaArtifactFactory {
* @param annotationName - the derived identifier's annotation (either @Id or @MapsId)
*/
private void addDerivedIdAnnotation(JavaPersistentType ownerJPT,
- JavaPersistentType inverseJPT, JavaPersistentAttribute ownerAttr,
+ JavaPersistentType inverseJPT, JavaModifiablePersistentAttribute ownerAttr,
String ownerIdClassFQN, String inverseIdClassFQN, String annotationName) {
if(!inverseIdClassFQN.equals(ownerIdClassFQN)){
String attributeType = JPAEditorUtil.returnSimpleName(inverseIdClassFQN);
@@ -2064,7 +2064,7 @@ public class JpaArtifactFactory {
* @param attributeTypeName - the attribute's type
*/
private void addFieldInCompositeKeyClass(JavaPersistentType inverseJPT,
- JavaPersistentAttribute ownerAttr, String fqnClass, String attributeTypeName) {
+ JavaModifiablePersistentAttribute ownerAttr, String fqnClass, String attributeTypeName) {
IJavaProject javaProject = JavaCore.create(ownerAttr.getJpaProject().getProject());
IType type = getType(javaProject, fqnClass);
if(type != null && !type.getField(ownerAttr.getName()).exists()){

Back to the top