diff options
author | Brian Vosburgh | 2013-02-27 19:22:37 +0000 |
---|---|---|
committer | Brian Vosburgh | 2013-03-05 20:01:18 +0000 |
commit | 44dc0f2c1da4e6b928454e4aa5ed28f1f383ebb4 (patch) | |
tree | 56c3b6061991b88c0f333606b290128f141ea6b4 /jpa_diagram_editor | |
parent | 79b6393d7f433da173102f9e7ade2d7d00b96b7b (diff) | |
download | webtools.dali-44dc0f2c1da4e6b928454e4aa5ed28f1f383ebb4.tar.gz webtools.dali-44dc0f2c1da4e6b928454e4aa5ed28f1f383ebb4.tar.xz webtools.dali-44dc0f2c1da4e6b928454e4aa5ed28f1f383ebb4.zip |
redirection: renamed Modifiable PersistentAttributes to Specified
PersistentAttributes
Diffstat (limited to 'jpa_diagram_editor')
52 files changed, 398 insertions, 398 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 89fb16d431..0d9b1c8bb9 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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(JavaModifiablePersistentAttribute.class)) { - resource = ((JavaModifiablePersistentAttribute) node).getResource(); + } else if (node.getType().isAssignableFrom(JavaSpecifiedPersistentAttribute.class)) { + resource = ((JavaSpecifiedPersistentAttribute) 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 4dbb7608fe..1aea5768ec 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.JavaModifiablePersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute;
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) {
- JavaModifiablePersistentAttribute attr = jpt.getAttributeNamed(actName);
+ JavaSpecifiedPersistentAttribute 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 bc34d28166..cc768c5909 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.JavaModifiablePersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute;
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 JavaModifiablePersistentAttribute newAt;
- private JavaModifiablePersistentAttribute oldAt;
+ private JavaSpecifiedPersistentAttribute newAt;
+ private JavaSpecifiedPersistentAttribute oldAt;
private IRelation rel;
public SetMappedByNewValueCommand(IJPAEditorFeatureProvider fp,
PersistenceUnit pu, String inverseEntityName,
- String inverseAttributeName, JavaModifiablePersistentAttribute newAt,
- JavaModifiablePersistentAttribute oldAt,
+ String inverseAttributeName, JavaSpecifiedPersistentAttribute newAt,
+ JavaSpecifiedPersistentAttribute 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 9847bbdf89..e9712c625a 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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 JavaModifiablePersistentAttribute)) { + if (!(o instanceof JavaSpecifiedPersistentAttribute)) { return null; } - final JavaModifiablePersistentAttribute newAttr = (JavaModifiablePersistentAttribute) o; + final JavaSpecifiedPersistentAttribute newAttr = (JavaSpecifiedPersistentAttribute) 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(JavaModifiablePersistentAttribute jpa) { + private void expand(JavaSpecifiedPersistentAttribute jpa) { ContainerShape attributeShape = (ContainerShape) getFeatureProvider().getPictogramElementForBusinessObject(jpa); ICustomContext customContext = new CustomContext(new PictogramElement[] { attributeShape.getContainer() }); expandCompartmentFeature.execute(customContext); } - private ContainerShape graphicalAdd(ContainerShape entityShape, JavaModifiablePersistentAttribute newAttr) { + private ContainerShape graphicalAdd(ContainerShape entityShape, JavaSpecifiedPersistentAttribute 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 JavaModifiablePersistentAttribute; + return o instanceof JavaSpecifiedPersistentAttribute; } }
\ 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 0238c6f23c..8bcec94fc8 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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<JavaModifiablePersistentAttribute> attributes = new ArrayList<JavaModifiablePersistentAttribute>(); + List<JavaSpecifiedPersistentAttribute> attributes = new ArrayList<JavaSpecifiedPersistentAttribute>(); - for (JavaModifiablePersistentAttribute attribute : jpt.getAttributes()) { + for (JavaSpecifiedPersistentAttribute 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<JavaModifiablePersistentAttribute> attributes = new ArrayList<JavaModifiablePersistentAttribute>(); + List<JavaSpecifiedPersistentAttribute> attributes = new ArrayList<JavaSpecifiedPersistentAttribute>(); - for (JavaModifiablePersistentAttribute attribute : jpt.getAttributes()){ + for (JavaSpecifiedPersistentAttribute 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<JavaModifiablePersistentAttribute> attributes) { + List<JavaSpecifiedPersistentAttribute> attributes) { for (int i = 0; i < attributes.size(); i++) { - JavaModifiablePersistentAttribute jpa = attributes.get(i); + JavaSpecifiedPersistentAttribute jpa = attributes.get(i); addAttribute(jpa, entityShape); } } @@ -433,7 +433,7 @@ public class AddJPAEntityFeature extends AbstractAddShapeFeature { } - private void addAttribute(JavaModifiablePersistentAttribute pa, + private void addAttribute(JavaSpecifiedPersistentAttribute 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 106715a355..68906ac2d3 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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 { - JavaModifiablePersistentAttribute inverse = rel.getInverse().getAttributeNamed(rel.getInverseAttributeName()); + JavaSpecifiedPersistentAttribute 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); } } - JavaModifiablePersistentAttribute owner = rel.getOwner().getAttributeNamed(rel.getOwnerAttributeName()); + JavaSpecifiedPersistentAttribute 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); - JavaModifiablePersistentAttribute owner = rel.getOwner().getAttributeNamed(rel.getOwnerAttributeName()); + JavaSpecifiedPersistentAttribute 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 ec1a26739f..6e0dcd5bfe 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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()); - JavaModifiablePersistentAttribute newAttr = (JavaModifiablePersistentAttribute) jpt.resolveAttribute(newAttrName); + JavaSpecifiedPersistentAttribute newAttr = (JavaSpecifiedPersistentAttribute) 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 0bc9b6e8fe..3961e3f492 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.JavaModifiablePersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute;
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());
- JavaModifiablePersistentAttribute newAttr = (JavaModifiablePersistentAttribute) jpt.resolveAttribute(newAttrName);
+ JavaSpecifiedPersistentAttribute newAttr = (JavaSpecifiedPersistentAttribute) 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 39e52da20b..a1c703c51c 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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(JavaModifiablePersistentAttribute jpa : ((JavaPersistentType)jpt).getAttributes()){ + for(JavaSpecifiedPersistentAttribute 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) { - JavaModifiablePersistentAttribute jpa = jpt.getAttributeNamed(attrName); + JavaSpecifiedPersistentAttribute 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, - JavaModifiablePersistentAttribute jpa) { + JavaSpecifiedPersistentAttribute 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(JavaModifiablePersistentAttribute jpa1 : jpt.getAttributes()){ + for(JavaSpecifiedPersistentAttribute 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(JavaModifiablePersistentAttribute jpa : perType.getAttributes()){ + for(JavaSpecifiedPersistentAttribute 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 9b1c7a7e98..da0d7ee679 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.JavaModifiablePersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute;
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(JavaModifiablePersistentAttribute jpa : subclass.getAttributes()){
+ for(JavaSpecifiedPersistentAttribute 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 1745cc9ce0..bcf725bf9d 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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; - JavaModifiablePersistentAttribute attribute = rel.getEmbeddedAnnotatedAttribute(); + JavaSpecifiedPersistentAttribute 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; - JavaModifiablePersistentAttribute attribute = relation.getAnnotatedAttribute(); + JavaSpecifiedPersistentAttribute 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()); - JavaModifiablePersistentAttribute ownerAttribute = relation.getOwnerAnnotatedAttribute(); + JavaSpecifiedPersistentAttribute ownerAttribute = relation.getOwnerAnnotatedAttribute(); PictogramElement ownerAttributeTextShape = getFeatureProvider().getPictogramElementForBusinessObject(ownerAttribute); if(ownerAttributeTextShape == null) return; IDeleteContext deleteOwnerAttributeContext = new DeleteContext(ownerAttributeTextShape); feat.delete(deleteOwnerAttributeContext, false); - JavaModifiablePersistentAttribute inverseAttribute = relation.getInverseAnnotatedAttribute(); + JavaSpecifiedPersistentAttribute 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 419516b917..af51a762cf 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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(); - JavaModifiablePersistentAttribute jpa = (JavaModifiablePersistentAttribute)getFeatureProvider(). + JavaSpecifiedPersistentAttribute jpa = (JavaSpecifiedPersistentAttribute)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(); - JavaModifiablePersistentAttribute oldAt = (JavaModifiablePersistentAttribute) getBusinessObjectForPictogramElement(pe); - JavaModifiablePersistentAttribute newAl = ((JavaPersistentType)oldAt.getParent()).getAttributeNamed(value); + JavaSpecifiedPersistentAttribute oldAt = (JavaSpecifiedPersistentAttribute) getBusinessObjectForPictogramElement(pe); + JavaSpecifiedPersistentAttribute 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(); - JavaModifiablePersistentAttribute oldAt = (JavaModifiablePersistentAttribute) getBusinessObjectForPictogramElement(pe); + JavaSpecifiedPersistentAttribute oldAt = (JavaSpecifiedPersistentAttribute) 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 daca15f0ce..3750b999c6 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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<JavaModifiablePersistentAttribute> ats = JpaArtifactFactory.instance().getRelatedAttributes(jpt); - Iterator<JavaModifiablePersistentAttribute> it = ats.iterator(); + Set<JavaSpecifiedPersistentAttribute> ats = JpaArtifactFactory.instance().getRelatedAttributes(jpt); + Iterator<JavaSpecifiedPersistentAttribute> it = ats.iterator(); while (it.hasNext()) { - JavaModifiablePersistentAttribute at = it.next(); + JavaSpecifiedPersistentAttribute 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 0256ee295e..eaba8d2e47 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.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute;
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$
}
- JavaModifiablePersistentAttribute embeddedAttribute = JPAEditorUtil.addAnnotatedAttribute(getFeatureProvider(), embeddingEntity, embeddable, true, mapKeyType);
+ JavaSpecifiedPersistentAttribute 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 e9f2a9dc88..241056c97d 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.JavaModifiablePersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute;
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());
- JavaModifiablePersistentAttribute embeddedAttribute = JPAEditorUtil.addAnnotatedAttribute(getFeatureProvider(), embeddingEntity, embeddable, false, null);
+ JavaSpecifiedPersistentAttribute 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 b3901033a4..caea634a59 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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() { - JavaModifiablePersistentAttribute newAttr = (JavaModifiablePersistentAttribute) context.getNewObject(); + JavaSpecifiedPersistentAttribute newAttr = (JavaSpecifiedPersistentAttribute) 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 dad775d9fd..4a29f255f9 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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 (JavaModifiablePersistentAttribute attribute : javaPersistentType.getAttributes()) { + for (JavaSpecifiedPersistentAttribute 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 4aef05d89c..8085c61899 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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 JavaModifiablePersistentAttribute))) + if ((bo == null) || (!(bo instanceof JavaSpecifiedPersistentAttribute))) return; - JavaModifiablePersistentAttribute jpa = (JavaModifiablePersistentAttribute)bo; + JavaSpecifiedPersistentAttribute jpa = (JavaSpecifiedPersistentAttribute)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()); - JavaModifiablePersistentAttribute newAt = JpaArtifactFactory.instance().makeNewAttribute(getFeatureProvider(), (JavaPersistentType)jpa.getParent(), + JavaSpecifiedPersistentAttribute 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 6b391095f2..4aa18c9ab8 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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<JavaModifiablePersistentAttribute> ats = null; + protected Set<JavaSpecifiedPersistentAttribute> 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(JavaModifiablePersistentAttribute oldAttr : oldJPT.getAttributes()){ + for(JavaSpecifiedPersistentAttribute oldAttr : oldJPT.getAttributes()){ PictogramElement attrPict = fp.getPictogramElementForBusinessObject(oldAttr); if(attrPict != null){ - for(JavaModifiablePersistentAttribute newAttr : newJPT.getAttributes()){ + for(JavaSpecifiedPersistentAttribute 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<JavaModifiablePersistentAttribute> iter = ats.iterator(); + final Iterator<JavaSpecifiedPersistentAttribute> iter = ats.iterator(); Runnable r = new Runnable() { public void run() { Hashtable<String, String> atOldToNewName = new Hashtable<String, String>(); - Set<JavaModifiablePersistentAttribute> newSelfAts = new HashSet<JavaModifiablePersistentAttribute>(); + Set<JavaSpecifiedPersistentAttribute> newSelfAts = new HashSet<JavaSpecifiedPersistentAttribute>(); while (iter.hasNext()) { - JavaModifiablePersistentAttribute at = iter.next(); + JavaSpecifiedPersistentAttribute at = iter.next(); JavaPersistentType atParent = (JavaPersistentType) at.getParent(); ICompilationUnit cu = getFeatureProvider().getCompilationUnit(atParent); if (!cu.exists()) { - at = (JavaModifiablePersistentAttribute)at.getPersistenceUnit().getPersistentType(newJptName).getAttributeNamed(at.getName()); - JavaModifiablePersistentAttribute newAt = null; + at = (JavaSpecifiedPersistentAttribute)at.getPersistenceUnit().getPersistentType(newJptName).getAttributeNamed(at.getName()); + JavaSpecifiedPersistentAttribute 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<JavaModifiablePersistentAttribute> itr = newSelfAts.iterator(); + Iterator<JavaSpecifiedPersistentAttribute> itr = newSelfAts.iterator(); while (itr.hasNext()) { - JavaModifiablePersistentAttribute at = itr.next(); + JavaSpecifiedPersistentAttribute 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 a9127df395..630bd24f1f 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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 JavaModifiablePersistentAttribute)) { + if ((o != null) && (o instanceof JavaSpecifiedPersistentAttribute)) { 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 1d42c2c96a..4a6d81a316 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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 JavaModifiablePersistentAttribute) { - JavaModifiablePersistentAttribute jpa = (JavaModifiablePersistentAttribute) bo; + if (bo instanceof JavaSpecifiedPersistentAttribute) { + JavaSpecifiedPersistentAttribute jpa = (JavaSpecifiedPersistentAttribute) 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 9297f6205a..909fae7555 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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 JavaModifiablePersistentAttribute)) { + if ((o != null) && (o instanceof JavaSpecifiedPersistentAttribute)) { 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 0f0ca84d8c..a8526f23ea 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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(JavaModifiablePersistentAttribute jpa); + public IRelation getRelationRelatedToAttribute(JavaSpecifiedPersistentAttribute jpa); - public HasReferanceRelation getEmbeddedRelationRelatedToAttribute(JavaModifiablePersistentAttribute jpa); + public HasReferanceRelation getEmbeddedRelationRelatedToAttribute(JavaSpecifiedPersistentAttribute jpa); public Object getBusinessObjectForKey(String key); @@ -93,9 +93,9 @@ public interface IJPAEditorFeatureProvider extends IFeatureProvider{ public int decreaseAttribsNum(Shape sh); - public void replaceAttribute(JavaModifiablePersistentAttribute oldAt, JavaModifiablePersistentAttribute newAt); + public void replaceAttribute(JavaSpecifiedPersistentAttribute oldAt, JavaSpecifiedPersistentAttribute newAt); - public void renewAttributeJoiningStrategyPropertyListener(JavaModifiablePersistentAttribute jpa); + public void renewAttributeJoiningStrategyPropertyListener(JavaSpecifiedPersistentAttribute 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 950569b667..7b2959ad29 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 @@ -71,10 +71,10 @@ import org.eclipse.jdt.internal.core.CompilationUnit; import org.eclipse.jdt.internal.core.SourceType; import org.eclipse.jpt.jpa.core.JpaModel; import org.eclipse.jpt.jpa.core.JpaProject; -import org.eclipse.jpt.jpa.core.context.ModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.SpecifiedPersistentAttribute; 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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; @@ -297,7 +297,7 @@ public class JPAEditorFeatureProvider extends DefaultFeatureProvider implements return new AddRelationFeature(this); } else if (newObj instanceof HasReferanceRelation) { return new AddHasReferenceRelationFeature(this); - } else if (newObj instanceof ModifiablePersistentAttribute) { + } else if (newObj instanceof SpecifiedPersistentAttribute) { if (Diagram.class.isInstance(context.getTargetContainer())) { return null; } @@ -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 JavaModifiablePersistentAttribute) { + } else if (bo instanceof JavaSpecifiedPersistentAttribute) { 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 JavaModifiablePersistentAttribute) { + if (bo instanceof JavaSpecifiedPersistentAttribute) { return new DirectEditAttributeFeature(this); } } @@ -487,7 +487,7 @@ public class JPAEditorFeatureProvider extends DefaultFeatureProvider implements return super.getDirectEditingFeature(context); } - public void renewAttributeJoiningStrategyPropertyListener(JavaModifiablePersistentAttribute jpa) { + public void renewAttributeJoiningStrategyPropertyListener(JavaSpecifiedPersistentAttribute jpa) { ((JPASolver)getIndependenceSolver()).renewAttributeJoiningStrategyPropertyListener(jpa); } @@ -595,7 +595,7 @@ public class JPAEditorFeatureProvider extends DefaultFeatureProvider implements return ((JPASolver)getIndependenceSolver()).containsKey(name); } - public void replaceAttribute(final JavaModifiablePersistentAttribute oldAt, final JavaModifiablePersistentAttribute newAt) { + public void replaceAttribute(final JavaSpecifiedPersistentAttribute oldAt, final JavaSpecifiedPersistentAttribute 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(JavaModifiablePersistentAttribute jpa) { + public boolean isRelationRelatedToAttribute(JavaSpecifiedPersistentAttribute jpa) { return ((JPASolver)getIndependenceSolver()).isRelationRelatedToAttribute(jpa); } - public IRelation getRelationRelatedToAttribute(JavaModifiablePersistentAttribute jpa) { + public IRelation getRelationRelatedToAttribute(JavaSpecifiedPersistentAttribute jpa) { return ((JPASolver)getIndependenceSolver()).getRelationRelatedToAttribute(jpa, this); } - public HasReferanceRelation getEmbeddedRelationRelatedToAttribute(JavaModifiablePersistentAttribute jpa) { + public HasReferanceRelation getEmbeddedRelationRelatedToAttribute(JavaSpecifiedPersistentAttribute 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 20c3fc8c77..6c3d8b5298 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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 JavaModifiablePersistentAttribute) { - return JPAEditorUtil.getTooltipText((JavaModifiablePersistentAttribute)bo); + if (bo instanceof JavaSpecifiedPersistentAttribute) { + return JPAEditorUtil.getTooltipText((JavaSpecifiedPersistentAttribute)bo); } } } @@ -683,8 +683,8 @@ public class JPAEditorToolBehaviorProvider extends DefaultToolBehaviorProvider { PictogramElement pe = context.getPictogramElements()[0]; Object bo = getFeatureProvider().getBusinessObjectForPictogramElement( pe); - if (bo instanceof JavaModifiablePersistentAttribute) { - JavaModifiablePersistentAttribute jpa = (JavaModifiablePersistentAttribute) bo; + if (bo instanceof JavaSpecifiedPersistentAttribute) { + JavaSpecifiedPersistentAttribute jpa = (JavaSpecifiedPersistentAttribute) 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 697fef109c..dd272dbedb 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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 JavaModifiablePersistentAttribute ownerAnnotatedAttribute; - protected JavaModifiablePersistentAttribute inverseAnnotatedAttribute; + protected JavaSpecifiedPersistentAttribute ownerAnnotatedAttribute; + protected JavaSpecifiedPersistentAttribute inverseAnnotatedAttribute; protected String ownerAttributeName; protected String inverseAttributeName; @@ -61,21 +61,21 @@ abstract public class AbstractRelation implements IRelation { return inverse; } - public JavaModifiablePersistentAttribute getInverseAnnotatedAttribute() { + public JavaSpecifiedPersistentAttribute getInverseAnnotatedAttribute() { return inverseAnnotatedAttribute; } - public JavaModifiablePersistentAttribute getOwnerAnnotatedAttribute() { + public JavaSpecifiedPersistentAttribute getOwnerAnnotatedAttribute() { return ownerAnnotatedAttribute; } public void setOwnerAnnotatedAttribute( - JavaModifiablePersistentAttribute ownerAnnotatedAttribute) { + JavaSpecifiedPersistentAttribute ownerAnnotatedAttribute) { this.ownerAnnotatedAttribute = ownerAnnotatedAttribute; } public void setInverseAnnotatedAttribute( - JavaModifiablePersistentAttribute inverseAnnotatedAttribute) { + JavaSpecifiedPersistentAttribute 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 282c5bfee7..9e1eccb9aa 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.JavaModifiablePersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute;
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 JavaModifiablePersistentAttribute embeddedAnnotatedAttribute;
+ private JavaSpecifiedPersistentAttribute embeddedAnnotatedAttribute;
public static enum HasReferenceType {
SINGLE, COLLECTION
@@ -96,11 +96,11 @@ public abstract class HasReferanceRelation { public abstract HasReferenceType getReferenceType();
- public JavaModifiablePersistentAttribute getEmbeddedAnnotatedAttribute() {
+ public JavaSpecifiedPersistentAttribute getEmbeddedAnnotatedAttribute() {
return embeddedAnnotatedAttribute;
}
- public void setEmbeddedAnnotatedAttribute(JavaModifiablePersistentAttribute embeddedAnnotatedAttribute) {
+ public void setEmbeddedAnnotatedAttribute(JavaSpecifiedPersistentAttribute 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 4de452cbd3..a95bdb2054 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; public interface IBidirectionalRelation extends IRelation { - public abstract JavaModifiablePersistentAttribute getOwnerAnnotatedAttribute(); + public abstract JavaSpecifiedPersistentAttribute getOwnerAnnotatedAttribute(); - public abstract JavaModifiablePersistentAttribute getInverseAnnotatedAttribute(); + public abstract JavaSpecifiedPersistentAttribute getInverseAnnotatedAttribute(); - public abstract void setOwnerAnnotatedAttribute(JavaModifiablePersistentAttribute ownerAnnotatedAttribute); + public abstract void setOwnerAnnotatedAttribute(JavaSpecifiedPersistentAttribute ownerAnnotatedAttribute); - public abstract void setInverseAnnotatedAttribute(JavaModifiablePersistentAttribute inverseAnnotatedAttribute); + public abstract void setInverseAnnotatedAttribute(JavaSpecifiedPersistentAttribute 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 59b19a7c7c..3384a71180 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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(JavaModifiablePersistentAttribute ownerAnnotatedAttribute); + public void setOwnerAnnotatedAttribute(JavaSpecifiedPersistentAttribute ownerAnnotatedAttribute); - public JavaModifiablePersistentAttribute getOwnerAnnotatedAttribute(); + public JavaSpecifiedPersistentAttribute getOwnerAnnotatedAttribute(); - public void setInverseAnnotatedAttribute(JavaModifiablePersistentAttribute inverseAnnotatedAttribute); + public void setInverseAnnotatedAttribute(JavaSpecifiedPersistentAttribute inverseAnnotatedAttribute); public void setOwnerAttributeName(String ownerAttributeName); public void setInverseAttributeName(String inverseAttributeName); - public abstract JavaModifiablePersistentAttribute getInverseAnnotatedAttribute(); + public abstract JavaSpecifiedPersistentAttribute 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 4c08330ba6..d2a0327b48 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; public interface IUnidirectionalRelation extends IRelation { - public abstract JavaModifiablePersistentAttribute getAnnotatedAttribute(); + public abstract JavaSpecifiedPersistentAttribute getAnnotatedAttribute(); - public abstract void setAnnotatedAttribute(JavaModifiablePersistentAttribute at); + public abstract void setAnnotatedAttribute(JavaSpecifiedPersistentAttribute 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 63cb906501..187a3faf84 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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 JavaModifiablePersistentAttribute getOwnerAnnotatedAttribute() { + public JavaSpecifiedPersistentAttribute getOwnerAnnotatedAttribute() { return ownerAnnotatedAttribute; } @Override public void setOwnerAnnotatedAttribute( - JavaModifiablePersistentAttribute ownerAnnotatedAttribute) { + JavaSpecifiedPersistentAttribute 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 JavaModifiablePersistentAttribute getInverseAnnotatedAttribute() { + public JavaSpecifiedPersistentAttribute getInverseAnnotatedAttribute() { return inverseAnnotatedAttribute; } @Override public void setInverseAnnotatedAttribute( - JavaModifiablePersistentAttribute inverseAnnotatedAttribute) { + JavaSpecifiedPersistentAttribute 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 257712d4f5..356b726ce6 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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 JavaModifiablePersistentAttribute getAnnotatedAttribute() { + public JavaSpecifiedPersistentAttribute getAnnotatedAttribute() { return ownerAnnotatedAttribute; } - public void setAnnotatedAttribute(JavaModifiablePersistentAttribute annotatedAttribute) { + public void setAnnotatedAttribute(JavaSpecifiedPersistentAttribute 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 5fb13eabec..467a9f3a9c 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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 JavaModifiablePersistentAttribute getOwnerAnnotatedAttribute() { + public JavaSpecifiedPersistentAttribute getOwnerAnnotatedAttribute() { return ownerAnnotatedAttribute; } @Override - public void setOwnerAnnotatedAttribute( JavaModifiablePersistentAttribute ownerAnnotatedAttribute) { + public void setOwnerAnnotatedAttribute( JavaSpecifiedPersistentAttribute ownerAnnotatedAttribute) { this.ownerAnnotatedAttribute = ownerAnnotatedAttribute; } @Override - public JavaModifiablePersistentAttribute getInverseAnnotatedAttribute() { + public JavaSpecifiedPersistentAttribute getInverseAnnotatedAttribute() { return inverseAnnotatedAttribute; } @Override - public void setInverseAnnotatedAttribute(JavaModifiablePersistentAttribute inverseAnnotatedAttribute) { + public void setInverseAnnotatedAttribute(JavaSpecifiedPersistentAttribute 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 435b7d1720..15f16428cd 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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 JavaModifiablePersistentAttribute getAnnotatedAttribute() { + public JavaSpecifiedPersistentAttribute getAnnotatedAttribute() { return ownerAnnotatedAttribute; } - public void setAnnotatedAttribute(JavaModifiablePersistentAttribute annotatedAttribute) { + public void setAnnotatedAttribute(JavaSpecifiedPersistentAttribute 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 e6661a8e7e..2635cbc1d7 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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 JavaModifiablePersistentAttribute getAnnotatedAttribute() { + public JavaSpecifiedPersistentAttribute getAnnotatedAttribute() { return ownerAnnotatedAttribute; } - public void setAnnotatedAttribute(JavaModifiablePersistentAttribute annotatedAttribute) { + public void setAnnotatedAttribute(JavaSpecifiedPersistentAttribute 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 ac438b8988..9cbb15f9de 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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 JavaModifiablePersistentAttribute getOwnerAnnotatedAttribute() { + public JavaSpecifiedPersistentAttribute getOwnerAnnotatedAttribute() { return ownerAnnotatedAttribute; } @Override public void setOwnerAnnotatedAttribute( - JavaModifiablePersistentAttribute ownerAnnotatedAttribute) { + JavaSpecifiedPersistentAttribute ownerAnnotatedAttribute) { this.ownerAnnotatedAttribute = ownerAnnotatedAttribute; } @Override - public JavaModifiablePersistentAttribute getInverseAnnotatedAttribute() { + public JavaSpecifiedPersistentAttribute getInverseAnnotatedAttribute() { return inverseAnnotatedAttribute; } @Override public void setInverseAnnotatedAttribute( - JavaModifiablePersistentAttribute inverseAnnotatedAttribute) { + JavaSpecifiedPersistentAttribute 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 ecb4c9ac52..011caf1c8b 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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 JavaModifiablePersistentAttribute getAnnotatedAttribute() { + public JavaSpecifiedPersistentAttribute getAnnotatedAttribute() { return ownerAnnotatedAttribute; } - public void setAnnotatedAttribute(JavaModifiablePersistentAttribute annotatedAttribute) { + public void setAnnotatedAttribute(JavaSpecifiedPersistentAttribute 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 d82eb7a1e1..76d9935fac 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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) { - JavaModifiablePersistentAttribute jpa = jpt.getAttributeNamed(attribName); + JavaSpecifiedPersistentAttribute 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 c3f94dd370..999c330a21 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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(JavaModifiablePersistentAttribute at) { + public static String getText(JavaSpecifiedPersistentAttribute at) { return at.getName(); } @@ -187,7 +187,7 @@ public class JPAEditorUtil { } - public static String getAttributeTypeName(JavaModifiablePersistentAttribute at) { + public static String getAttributeTypeName(JavaSpecifiedPersistentAttribute at) { return getAttributeTypeName(at.getResourceAttribute()); } @@ -195,7 +195,7 @@ public class JPAEditorUtil { return at.getTypeBinding().getQualifiedName(); } - public static String getAttributeTypeNameWithGenerics(JavaModifiablePersistentAttribute at) { + public static String getAttributeTypeNameWithGenerics(JavaSpecifiedPersistentAttribute at) { return getAttributeTypeNameWithGenerics(at.getResourceAttribute()); } @@ -1303,7 +1303,7 @@ public class JPAEditorUtil { } - public static String getTooltipText(JavaModifiablePersistentAttribute at) { + public static String getTooltipText(JavaSpecifiedPersistentAttribute 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 JavaModifiablePersistentAttribute addAnnotatedAttribute(IJPAEditorFeatureProvider fp, JavaPersistentType referencingJPT, + public static JavaSpecifiedPersistentAttribute 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 e7cbaf48c4..ff29acbf85 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 @@ -89,7 +89,7 @@ import org.eclipse.jpt.jpa.core.context.ManyToOneMapping; import org.eclipse.jpt.jpa.core.context.MappedByRelationshipStrategy; import org.eclipse.jpt.jpa.core.context.OneToOneMapping; import org.eclipse.jpt.jpa.core.context.OptionalMapping; -import org.eclipse.jpt.jpa.core.context.ModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.SpecifiedPersistentAttribute; import org.eclipse.jpt.jpa.core.context.PersistentType; import org.eclipse.jpt.jpa.core.context.ReadOnlyRelationship; import org.eclipse.jpt.jpa.core.context.Relationship; @@ -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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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<JavaModifiablePersistentAttribute, WeakReference<AttributePropertyChangeListener>> attributeToPropListener; - private WeakHashMap<JavaModifiablePersistentAttribute, WeakReference<AttributeMappingOptionalityChangeListener>> attributeMappingOptionalityToPropListener; - private WeakHashMap<JavaModifiablePersistentAttribute, WeakReference<AttributeJoiningStrategyPropertyChangeListener>> attributeJoiningStrategyToPropListener; - private WeakHashMap<JavaModifiablePersistentAttribute, WeakReference<AttributeRelationshipReferencePropertyChangeListener>> attributeRelationshipReferenceToPropListener; + private WeakHashMap<JavaSpecifiedPersistentAttribute, WeakReference<AttributePropertyChangeListener>> attributeToPropListener; + private WeakHashMap<JavaSpecifiedPersistentAttribute, WeakReference<AttributeMappingOptionalityChangeListener>> attributeMappingOptionalityToPropListener; + private WeakHashMap<JavaSpecifiedPersistentAttribute, WeakReference<AttributeJoiningStrategyPropertyChangeListener>> attributeJoiningStrategyToPropListener; + private WeakHashMap<JavaSpecifiedPersistentAttribute, 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<JavaModifiablePersistentAttribute, WeakReference<AttributePropertyChangeListener>>(); - attributeMappingOptionalityToPropListener = new WeakHashMap<JavaModifiablePersistentAttribute, WeakReference<AttributeMappingOptionalityChangeListener>>(); - attributeJoiningStrategyToPropListener = new WeakHashMap<JavaModifiablePersistentAttribute, WeakReference<AttributeJoiningStrategyPropertyChangeListener>>(); - attributeRelationshipReferenceToPropListener = new WeakHashMap<JavaModifiablePersistentAttribute, WeakReference<AttributeRelationshipReferencePropertyChangeListener>>(); + attributeToPropListener = new WeakHashMap<JavaSpecifiedPersistentAttribute, WeakReference<AttributePropertyChangeListener>>(); + attributeMappingOptionalityToPropListener = new WeakHashMap<JavaSpecifiedPersistentAttribute, WeakReference<AttributeMappingOptionalityChangeListener>>(); + attributeJoiningStrategyToPropListener = new WeakHashMap<JavaSpecifiedPersistentAttribute, WeakReference<AttributeJoiningStrategyPropertyChangeListener>>(); + attributeRelationshipReferenceToPropListener = new WeakHashMap<JavaSpecifiedPersistentAttribute, 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 JavaModifiablePersistentAttribute) { - JavaModifiablePersistentAttribute at = (JavaModifiablePersistentAttribute) bo; + } else if (bo instanceof JavaSpecifiedPersistentAttribute) { + JavaSpecifiedPersistentAttribute at = (JavaSpecifiedPersistentAttribute) 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 JavaModifiablePersistentAttribute) { - addPropertiesListenerToAttribute((JavaModifiablePersistentAttribute)bo); + } else if (bo instanceof JavaSpecifiedPersistentAttribute) { + addPropertiesListenerToAttribute((JavaSpecifiedPersistentAttribute)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 (JavaModifiablePersistentAttribute at : jpt.getAttributes()) { + for (JavaSpecifiedPersistentAttribute 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 JavaModifiablePersistentAttribute) { - removeListenersFromAttribute((JavaModifiablePersistentAttribute)o); + } else if (o instanceof JavaSpecifiedPersistentAttribute) { + removeListenersFromAttribute((JavaSpecifiedPersistentAttribute)o); } return o; } @@ -407,12 +407,12 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver { return util.getCompilationUnit(jpt); } - public boolean isRelationRelatedToAttribute(JavaModifiablePersistentAttribute jpa) { + public boolean isRelationRelatedToAttribute(JavaSpecifiedPersistentAttribute jpa) { String key = produceKeyForRel((JavaPersistentType)jpa.getParent(), jpa.getName()); return attribToRel.containsKey(key); } - public IRelation getRelationRelatedToAttribute(JavaModifiablePersistentAttribute jpa, IJPAEditorFeatureProvider fp) { + public IRelation getRelationRelatedToAttribute(JavaSpecifiedPersistentAttribute 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 JavaModifiablePersistentAttribute} which will be renamed + * @param jpa - the {@link JavaSpecifiedPersistentAttribute} which will be renamed * @param fp * @return the unique key for the relationship. */ - private String findRelationshipKey(JavaModifiablePersistentAttribute jpa, IJPAEditorFeatureProvider fp){ + private String findRelationshipKey(JavaSpecifiedPersistentAttribute 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 (JavaModifiablePersistentAttribute relEntAt : embeddableClass.getAttributes()) { + for (JavaSpecifiedPersistentAttribute 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(JavaModifiablePersistentAttribute attribute : jpt.getAttributes()){ + for(JavaSpecifiedPersistentAttribute 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(JavaModifiablePersistentAttribute jpa) { + public HasReferanceRelation getEmbeddedRelationToAttribute(JavaSpecifiedPersistentAttribute 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(JavaModifiablePersistentAttribute jpa) { + public void renewAttributeMappingPropListener(JavaSpecifiedPersistentAttribute jpa) { renewAttributeJoiningStrategyPropertyListener(jpa); renewAttributeMappingOptPropListener(jpa); } - public void renewAttributeJoiningStrategyPropertyListener(JavaModifiablePersistentAttribute jpa) { + public void renewAttributeJoiningStrategyPropertyListener(JavaSpecifiedPersistentAttribute jpa) { AttributeJoiningStrategyPropertyChangeListener lsn = null; if (attributeJoiningStrategyToPropListener == null) return; @@ -525,7 +525,7 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver { } - public void renewAttributeMappingOptPropListener(JavaModifiablePersistentAttribute jpa) { + public void renewAttributeMappingOptPropListener(JavaSpecifiedPersistentAttribute jpa) { AttributeMappingOptionalityChangeListener lsn = null; WeakReference<AttributeMappingOptionalityChangeListener> ref = attributeMappingOptionalityToPropListener.remove(jpa); if (ref != null) @@ -602,27 +602,27 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver { } } - private void addPropertiesListenerToAttribute(JavaModifiablePersistentAttribute jpa) { + private void addPropertiesListenerToAttribute(JavaSpecifiedPersistentAttribute jpa) { addPropertiesListenerToAttributeItself(jpa); addPropertiesListenerToJoiningStrategy(jpa); addPropertiesListenerToRelationshipReference(jpa); addOptPropListenerToAttributeMapping(jpa); } - private void addPropertiesListenerToAttributeItself(JavaModifiablePersistentAttribute jpa) { + private void addPropertiesListenerToAttributeItself(JavaSpecifiedPersistentAttribute jpa) { WeakReference<AttributePropertyChangeListener> lsnrRef = attributeToPropListener.get(jpa); AttributePropertyChangeListener lsnr = null; if (lsnrRef != null) lsnr = lsnrRef.get(); if (lsnr == null) { lsnr = new AttributePropertyChangeListener(); - jpa.addPropertyChangeListener(ModifiablePersistentAttribute.MAPPING_PROPERTY, lsnr); + jpa.addPropertyChangeListener(SpecifiedPersistentAttribute.MAPPING_PROPERTY, lsnr); lsnrRef = new WeakReference<AttributePropertyChangeListener>(lsnr); attributeToPropListener.put(jpa, lsnrRef); } } - private void addOptPropListenerToAttributeMapping(JavaModifiablePersistentAttribute jpa) { + private void addOptPropListenerToAttributeMapping(JavaSpecifiedPersistentAttribute 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(JavaModifiablePersistentAttribute jpa) { + private void addPropertiesListenerToJoiningStrategy(JavaSpecifiedPersistentAttribute jpa) { WeakReference<AttributeJoiningStrategyPropertyChangeListener> lsnrRef = attributeJoiningStrategyToPropListener.get(jpa); AttributeJoiningStrategyPropertyChangeListener lsnr = null; @@ -667,7 +667,7 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver { } - private void addPropertiesListenerToRelationshipReference(JavaModifiablePersistentAttribute jpa) { + private void addPropertiesListenerToRelationshipReference(JavaSpecifiedPersistentAttribute 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(JavaModifiablePersistentAttribute jpa) { + private void removeListenersFromAttribute(JavaSpecifiedPersistentAttribute jpa) { removePropListenerFromAttribute(jpa); } @@ -741,14 +741,14 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver { } } - private void removePropListenerFromAttribute(JavaModifiablePersistentAttribute jpa) { + private void removePropListenerFromAttribute(JavaSpecifiedPersistentAttribute jpa) { removePropListenerFromAttributeItself(jpa); removePropListenerFromJoiningStrategy(jpa); removePropListenerFromRelationshipReference(jpa); removeOptPropListenerFromAttributeMapping(jpa); } - private void removePropListenerFromAttributeItself(JavaModifiablePersistentAttribute jpa) { + private void removePropListenerFromAttributeItself(JavaSpecifiedPersistentAttribute jpa) { WeakReference<AttributePropertyChangeListener> lsnrRef = attributeToPropListener.get(jpa); PropertyChangeListener lsnr = null; if (lsnrRef != null) @@ -756,14 +756,14 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver { if (lsnr != null) { attributeToPropListener.remove(jpa); try { - jpa.removePropertyChangeListener(ModifiablePersistentAttribute.MAPPING_PROPERTY, lsnr); + jpa.removePropertyChangeListener(SpecifiedPersistentAttribute.MAPPING_PROPERTY, lsnr); } catch (IllegalArgumentException e) { //$NON-NLS-1$ } } } - private void removePropListenerFromJoiningStrategy(JavaModifiablePersistentAttribute jpa) { + private void removePropListenerFromJoiningStrategy(JavaSpecifiedPersistentAttribute 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(JavaModifiablePersistentAttribute jpa) { + private void removeOptPropListenerFromAttributeMapping(JavaSpecifiedPersistentAttribute 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(JavaModifiablePersistentAttribute jpa) { + private void removePropListenerFromRelationshipReference(JavaSpecifiedPersistentAttribute jpa) { WeakReference<AttributeRelationshipReferencePropertyChangeListener> lsnrRef = attributeRelationshipReferenceToPropListener.get(jpa); PropertyChangeListener lsnr = null; lsnrRef = attributeRelationshipReferenceToPropListener.get(jpa); @@ -879,18 +879,18 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver { } private void removeAttributePropChangeListeners() { - Iterator<JavaModifiablePersistentAttribute> it = attributeToPropListener.keySet().iterator(); - Set<JavaModifiablePersistentAttribute> s = new HashSet<JavaModifiablePersistentAttribute>(); + Iterator<JavaSpecifiedPersistentAttribute> it = attributeToPropListener.keySet().iterator(); + Set<JavaSpecifiedPersistentAttribute> s = new HashSet<JavaSpecifiedPersistentAttribute>(); while(it.hasNext()) s.add(it.next()); it = s.iterator(); while(it.hasNext()) { - JavaModifiablePersistentAttribute jpa = it.next(); + JavaSpecifiedPersistentAttribute jpa = it.next(); WeakReference<AttributePropertyChangeListener> ref = attributeToPropListener.remove(jpa); PropertyChangeListener lsn = ref.get(); if (lsn != null) try { - jpa.removePropertyChangeListener(ModifiablePersistentAttribute.MAPPING_PROPERTY, lsn); + jpa.removePropertyChangeListener(SpecifiedPersistentAttribute.MAPPING_PROPERTY, lsn); } catch (IllegalArgumentException e) { //$NON-NLS-1$ } @@ -900,13 +900,13 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver { } private void removeAttributeJoiningStrategyPropChangeListeners() { - Iterator<JavaModifiablePersistentAttribute> it = attributeJoiningStrategyToPropListener.keySet().iterator(); - Set<JavaModifiablePersistentAttribute> s = new HashSet<JavaModifiablePersistentAttribute>(); + Iterator<JavaSpecifiedPersistentAttribute> it = attributeJoiningStrategyToPropListener.keySet().iterator(); + Set<JavaSpecifiedPersistentAttribute> s = new HashSet<JavaSpecifiedPersistentAttribute>(); while(it.hasNext()) s.add(it.next()); it = s.iterator(); while(it.hasNext()) { - JavaModifiablePersistentAttribute jpa = it.next(); + JavaSpecifiedPersistentAttribute 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<JavaModifiablePersistentAttribute> it = this.attributeMappingOptionalityToPropListener.keySet().iterator(); - Set<JavaModifiablePersistentAttribute> s = new HashSet<JavaModifiablePersistentAttribute>(); + Iterator<JavaSpecifiedPersistentAttribute> it = this.attributeMappingOptionalityToPropListener.keySet().iterator(); + Set<JavaSpecifiedPersistentAttribute> s = new HashSet<JavaSpecifiedPersistentAttribute>(); while(it.hasNext()) s.add(it.next()); it = s.iterator(); while(it.hasNext()) { - JavaModifiablePersistentAttribute jpa = it.next(); + JavaSpecifiedPersistentAttribute 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 (!JavaModifiablePersistentAttribute.class.isInstance(source)) + if (!JavaSpecifiedPersistentAttribute.class.isInstance(source)) return; PictogramElement pe = featureProvider - .getPictogramElementForBusinessObject(((JavaModifiablePersistentAttribute) source) + .getPictogramElementForBusinessObject(((JavaSpecifiedPersistentAttribute) source) .getParent()); final GraphicalRemoveAttributeFeature remove = new GraphicalRemoveAttributeFeature(featureProvider); final CustomContext ctx = new CustomContext(); @@ -1199,8 +1199,8 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver { }; Display.getDefault().asyncExec(runnable); String propName = event.getPropertyName(); - if (propName.equals(ModifiablePersistentAttribute.MAPPING_PROPERTY)) { - renewAttributeMappingPropListener((JavaModifiablePersistentAttribute) source); + if (propName.equals(SpecifiedPersistentAttribute.MAPPING_PROPERTY)) { + renewAttributeMappingPropListener((JavaSpecifiedPersistentAttribute) source); } } } @@ -1223,9 +1223,9 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver { if (nd == null) return; nd = nd.getParent(); - if ((nd == null) || !JavaModifiablePersistentAttribute.class.isInstance(nd)) + if ((nd == null) || !JavaSpecifiedPersistentAttribute.class.isInstance(nd)) return; - JavaModifiablePersistentAttribute at = (JavaModifiablePersistentAttribute)nd; + JavaSpecifiedPersistentAttribute at = (JavaSpecifiedPersistentAttribute)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 (!JavaModifiablePersistentAttribute.class.isInstance(p)) + if (!JavaSpecifiedPersistentAttribute.class.isInstance(p)) return; - JavaModifiablePersistentAttribute jpa = (JavaModifiablePersistentAttribute)p; + JavaSpecifiedPersistentAttribute jpa = (JavaSpecifiedPersistentAttribute)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(); - JavaModifiablePersistentAttribute jpa = (JavaModifiablePersistentAttribute)nm.getParent(); + JavaSpecifiedPersistentAttribute jpa = (JavaSpecifiedPersistentAttribute)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<JavaModifiablePersistentAttribute> it = (Iterator<JavaModifiablePersistentAttribute>) event.getItems().iterator(); + Iterator<JavaSpecifiedPersistentAttribute> it = (Iterator<JavaSpecifiedPersistentAttribute>) event.getItems().iterator(); Set<Shape> shapesToRemove = new HashSet<Shape>(); while (it.hasNext()) { - JavaModifiablePersistentAttribute at = it.next(); + JavaSpecifiedPersistentAttribute at = it.next(); /* String key = getKeyForBusinessObject(at); remove(key); @@ -1347,7 +1347,7 @@ public class JPASolver implements IResourceChangeListener, IJpaSolver { JavaPersistentType jpt = (JavaPersistentType)event.getSource(); - JavaModifiablePersistentAttribute newAt = jpt.getAttributeNamed(at.getName()); + JavaSpecifiedPersistentAttribute 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<JavaModifiablePersistentAttribute> it = (Iterator<JavaModifiablePersistentAttribute>) event.getItems().iterator(); + Iterator<JavaSpecifiedPersistentAttribute> it = (Iterator<JavaSpecifiedPersistentAttribute>) event.getItems().iterator(); while (it.hasNext()) { - JavaModifiablePersistentAttribute at = it.next(); + JavaSpecifiedPersistentAttribute 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 9dc362df1f..0f3ec9add2 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.PersistentAttribute; 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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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, - JavaModifiablePersistentAttribute attribute) { + JavaSpecifiedPersistentAttribute attribute) { addOneToOneRelation(fp, jpt, attribute, null, null, JPAEditorConstants.RELATION_TYPE_UNIDIRECTIONAL); } public void addOneToOneBidirectionalRelation (IFeatureProvider fp, JavaPersistentType jpt1, - JavaModifiablePersistentAttribute attribute1, JavaPersistentType jpt2, - JavaModifiablePersistentAttribute attribute2) { + JavaSpecifiedPersistentAttribute attribute1, JavaPersistentType jpt2, + JavaSpecifiedPersistentAttribute attribute2) { addOneToOneRelation(fp, jpt1, attribute1, jpt2, attribute2, JPAEditorConstants.RELATION_TYPE_BIDIRECTIONAL); } public void addOneToManyUnidirectionalRelation(IFeatureProvider fp, JavaPersistentType jpt, - JavaModifiablePersistentAttribute attribute, boolean isMap) { + JavaSpecifiedPersistentAttribute attribute, boolean isMap) { addOneToManyRelation(fp, jpt, attribute, null, null, JPAEditorConstants.RELATION_TYPE_UNIDIRECTIONAL, isMap); } public void addOneToManyBidirectionalRelation(IFeatureProvider fp, JavaPersistentType jpt1, - JavaModifiablePersistentAttribute attribute1, JavaPersistentType jpt2, - JavaModifiablePersistentAttribute attribute2, boolean isMap) { + JavaSpecifiedPersistentAttribute attribute1, JavaPersistentType jpt2, + JavaSpecifiedPersistentAttribute attribute2, boolean isMap) { addOneToManyRelation(fp, jpt1, attribute1, jpt2, attribute2, JPAEditorConstants.RELATION_TYPE_BIDIRECTIONAL, isMap); } public void addManyToOneBidirectionalRelation(IFeatureProvider fp, JavaPersistentType jpt1, - JavaModifiablePersistentAttribute attribute1, JavaPersistentType jpt2, - JavaModifiablePersistentAttribute attribute2, boolean isMap) { + JavaSpecifiedPersistentAttribute attribute1, JavaPersistentType jpt2, + JavaSpecifiedPersistentAttribute attribute2, boolean isMap) { addManyToOneRelation(fp, jpt1, attribute1, jpt2, attribute2, JPAEditorConstants.RELATION_TYPE_BIDIRECTIONAL, isMap); } public void addOneToOneRelation(IFeatureProvider fp, - JavaPersistentType ownerJPT, JavaModifiablePersistentAttribute ownerAttibute, + JavaPersistentType ownerJPT, JavaSpecifiedPersistentAttribute ownerAttibute, JavaPersistentType referencedJPT, - JavaModifiablePersistentAttribute referencedAttribute, int direction) { + JavaSpecifiedPersistentAttribute referencedAttribute, int direction) { setMappingKeyToAttribute(fp, ownerJPT, ownerAttibute, MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY); if (direction == JPAEditorConstants.RELATION_TYPE_BIDIRECTIONAL) { - JavaModifiablePersistentAttribute resolvedAttribute = setMappingKeyToAttribute(fp, referencedJPT, referencedAttribute, MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY); + JavaSpecifiedPersistentAttribute 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, - JavaModifiablePersistentAttribute manySideAttribute, JavaPersistentType singleSideJPT, - JavaModifiablePersistentAttribute singleSideAttibute, int direction, boolean isMap) { + JavaSpecifiedPersistentAttribute manySideAttribute, JavaPersistentType singleSideJPT, + JavaSpecifiedPersistentAttribute singleSideAttibute, int direction, boolean isMap) { setMappingKeyToAttribute(fp, manySideJPT, manySideAttribute, MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY); if (direction == JPAEditorConstants.RELATION_TYPE_UNIDIRECTIONAL) return; - JavaModifiablePersistentAttribute resolvedSingleSideAttribute = setMappingKeyToAttribute(fp, singleSideJPT, singleSideAttibute, MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY); + JavaSpecifiedPersistentAttribute 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, - JavaModifiablePersistentAttribute singleSideAttibute, + JavaSpecifiedPersistentAttribute singleSideAttibute, JavaPersistentType manySideJPT, - JavaModifiablePersistentAttribute manySideAttribute, int direction, boolean isMap) { + JavaSpecifiedPersistentAttribute manySideAttribute, int direction, boolean isMap) { - JavaModifiablePersistentAttribute resolvedSingleSideAttribute = setMappingKeyToAttribute(fp, singleSideJPT, singleSideAttibute, MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY); + JavaSpecifiedPersistentAttribute 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, JavaModifiablePersistentAttribute ownerSideAttribute) { + JavaPersistentType ownerSideJPT, JavaSpecifiedPersistentAttribute ownerSideAttribute) { String mappedByAttr = ownerSideAttribute.getName(); if(hasEmbeddableAnnotation(ownerSideJPT)){ HasReferanceRelation ref = JpaArtifactFactory.INSTANCE.findFisrtHasReferenceRelationByEmbeddable(ownerSideJPT, (IJPAEditorFeatureProvider)fp); if(ref != null){ - JavaModifiablePersistentAttribute embeddingAttribute = ref.getEmbeddedAnnotatedAttribute(); + JavaSpecifiedPersistentAttribute embeddingAttribute = ref.getEmbeddedAnnotatedAttribute(); mappedByAttr = embeddingAttribute.getName() + "." + ownerSideAttribute.getName(); //$NON-NLS-1$ } } return mappedByAttr; } - private void setMappedByAnnotationAttribute(JavaModifiablePersistentAttribute resolvedAttr, JavaPersistentType type1, String jpaName){ + private void setMappedByAnnotationAttribute(JavaSpecifiedPersistentAttribute 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 JavaModifiablePersistentAttribute setMappingKeyToAttribute(IFeatureProvider fp, JavaPersistentType jpt, JavaModifiablePersistentAttribute jpa, String mappingKey){ - JavaModifiablePersistentAttribute resolvedManySideAttribute = (JavaModifiablePersistentAttribute) jpt.resolveAttribute(jpa.getName()); + private JavaSpecifiedPersistentAttribute setMappingKeyToAttribute(IFeatureProvider fp, JavaPersistentType jpt, JavaSpecifiedPersistentAttribute jpa, String mappingKey){ + JavaSpecifiedPersistentAttribute resolvedManySideAttribute = (JavaSpecifiedPersistentAttribute) jpt.resolveAttribute(jpa.getName()); resolvedManySideAttribute.setMappingKey(mappingKey); return resolvedManySideAttribute; } - private void addJoinColumnIfNecessary(JavaModifiablePersistentAttribute jpa, + private void addJoinColumnIfNecessary(JavaSpecifiedPersistentAttribute jpa, JavaPersistentType jpt) { if (JPAEditorUtil.checkJPAFacetVersion(jpa.getJpaProject(), JPAEditorUtil.JPA_PROJECT_FACET_10) || JPADiagramPropertyPage.shouldOneToManyUnidirBeOldStyle(jpa .getJpaProject().getProject())) return; - JavaModifiablePersistentAttribute[] ids = getIds(jpt); + JavaSpecifiedPersistentAttribute[] 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); - JavaModifiablePersistentAttribute at = (JavaModifiablePersistentAttribute) am + JavaSpecifiedPersistentAttribute at = (JavaSpecifiedPersistentAttribute) am .getPersistentAttribute(); String idColName = atNameToColName.get(at.getName()); idColName = (idColName != null) ? idColName @@ -337,7 +337,7 @@ public class JpaArtifactFactory { } } } else { - for (JavaModifiablePersistentAttribute idAt : ids) { + for (JavaSpecifiedPersistentAttribute 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( - JavaModifiablePersistentAttribute embIdAt) { + JavaSpecifiedPersistentAttribute 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, - JavaModifiablePersistentAttribute attribute) { + JavaSpecifiedPersistentAttribute 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, - JavaModifiablePersistentAttribute attribute1, JavaPersistentType jpt2, - JavaModifiablePersistentAttribute attribute2, boolean isMap) { + JavaSpecifiedPersistentAttribute attribute1, JavaPersistentType jpt2, + JavaSpecifiedPersistentAttribute attribute2, boolean isMap) { addManyToManyRelation(fp, jpt1, attribute1, jpt2, attribute2, JPAEditorConstants.RELATION_TYPE_BIDIRECTIONAL, isMap); } public void addManyToManyUnidirectionalRelation(IFeatureProvider fp, JavaPersistentType annotatedJPT, - JavaModifiablePersistentAttribute annotatedAttribute, boolean isMap) { + JavaSpecifiedPersistentAttribute annotatedAttribute, boolean isMap) { addManyToManyRelation(fp, annotatedJPT, annotatedAttribute, null, null, JPAEditorConstants.RELATION_TYPE_UNIDIRECTIONAL, isMap); } public void addManyToManyRelation(IFeatureProvider fp, JavaPersistentType ownerSideJPT, - JavaModifiablePersistentAttribute ownerSideAttribute, + JavaSpecifiedPersistentAttribute ownerSideAttribute, JavaPersistentType inverseSideJPT, - JavaModifiablePersistentAttribute inverseSideAttibute, int direction, boolean isMap) { + JavaSpecifiedPersistentAttribute inverseSideAttibute, int direction, boolean isMap) { - JavaModifiablePersistentAttribute resolvedOwnerSideAttribute = setMappingKeyToAttribute(fp, ownerSideJPT, ownerSideAttribute, MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY); + JavaSpecifiedPersistentAttribute 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) { - JavaModifiablePersistentAttribute resolvedInverseSideAttribute = setMappingKeyToAttribute(fp, inverseSideJPT, inverseSideAttibute, MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY); + JavaSpecifiedPersistentAttribute 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(JavaModifiablePersistentAttribute jpa : ((JavaPersistentType)jpt).getAttributes()){ + for(JavaSpecifiedPersistentAttribute 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 JavaModifiablePersistentAttribute addAttribute(IJPAEditorFeatureProvider fp, JavaPersistentType jpt, + public JavaSpecifiedPersistentAttribute addAttribute(IJPAEditorFeatureProvider fp, JavaPersistentType jpt, JavaPersistentType attributeType, String mapKeyType, String attributeName, String actName, boolean isCollection, ICompilationUnit cu) { try { if (doesAttributeExist(jpt, actName)) { - return (JavaModifiablePersistentAttribute) jpt.resolveAttribute(attributeName); + return (JavaSpecifiedPersistentAttribute) jpt.resolveAttribute(attributeName); } } catch (JavaModelException e) { JPADiagramEditorPlugin.logError("Cannnot create a new attribute with name " + attributeName, e); //$NON-NLS-1$ } - JavaModifiablePersistentAttribute res = makeNewAttribute(fp, jpt, cu, attributeName, attributeType.getName(), actName, mapKeyType, null, null, isCollection); + JavaSpecifiedPersistentAttribute 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 JavaModifiablePersistentAttribute makeNewAttribute(IJPAEditorFeatureProvider fp, JavaPersistentType jpt, ICompilationUnit cu, String attrName, String attrTypeName, + public JavaSpecifiedPersistentAttribute 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$ } - JavaModifiablePersistentAttribute jpa = jpt.getAttributeNamed(attrName); + JavaSpecifiedPersistentAttribute 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(JavaModifiablePersistentAttribute persistentAttribite) { + public Annotation[] getAnnotations(JavaSpecifiedPersistentAttribute 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(JavaModifiablePersistentAttribute persistentAttribite) { + public HashSet<String> getAnnotationNames(JavaSpecifiedPersistentAttribute 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( - JavaModifiablePersistentAttribute persistentAttribite) { + JavaSpecifiedPersistentAttribute 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(JavaModifiablePersistentAttribute at) { + private boolean isNonOwner(JavaSpecifiedPersistentAttribute 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 (JavaModifiablePersistentAttribute embeddingAttribute : embeddingEntity.getAttributes()) { + for (JavaSpecifiedPersistentAttribute 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(JavaModifiablePersistentAttribute persistentAttribite, JavaPersistentType jpt2, + public IRelation produceIRelation(JavaSpecifiedPersistentAttribute 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(JavaModifiablePersistentAttribute persistentAttribite, IJPAEditorFeatureProvider fp, Annotation an) { + public JavaPersistentType findJPT(JavaSpecifiedPersistentAttribute 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 (JavaModifiablePersistentAttribute at : newJPT.getAttributes()) { + for (JavaSpecifiedPersistentAttribute 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<JavaModifiablePersistentAttribute> getRelatedAttributes(JavaPersistentType jpt) { - Set<JavaModifiablePersistentAttribute> res = new HashSet<JavaModifiablePersistentAttribute>(); + public Set<JavaSpecifiedPersistentAttribute> getRelatedAttributes(JavaPersistentType jpt) { + Set<JavaSpecifiedPersistentAttribute> res = new HashSet<JavaSpecifiedPersistentAttribute>(); 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<JavaModifiablePersistentAttribute> relAts = getRelAttributes(jpt, jpt1); + Set<JavaSpecifiedPersistentAttribute> 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<JavaModifiablePersistentAttribute> getRelAttributes(JavaPersistentType jpt, + private Set<JavaSpecifiedPersistentAttribute> getRelAttributes(JavaPersistentType jpt, JavaPersistentType relJPT) { - Set<JavaModifiablePersistentAttribute> res = new HashSet<JavaModifiablePersistentAttribute>(); - for (JavaModifiablePersistentAttribute at : relJPT.getAttributes()) { + Set<JavaSpecifiedPersistentAttribute> res = new HashSet<JavaSpecifiedPersistentAttribute>(); + for (JavaSpecifiedPersistentAttribute at : relJPT.getAttributes()) { IResource r = at.getParent().getResource(); if (!r.exists()) throw new RuntimeException(); @@ -1178,7 +1178,7 @@ public class JpaArtifactFactory { } } - public JavaModifiablePersistentAttribute renameAttribute(JavaPersistentType jpt, + public JavaSpecifiedPersistentAttribute 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; - JavaModifiablePersistentAttribute oldAt = jpt.getAttributeNamed(oldName); + JavaSpecifiedPersistentAttribute 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()); - JavaModifiablePersistentAttribute newAt = jpt.getAttributeNamed(newName); + JavaSpecifiedPersistentAttribute 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, JavaModifiablePersistentAttribute oldAt, - JavaModifiablePersistentAttribute newAt) throws InterruptedException { + PersistenceUnit pu, JavaSpecifiedPersistentAttribute oldAt, + JavaSpecifiedPersistentAttribute newAt) throws InterruptedException { IRelation rel = fp.getRelationRelatedToAttribute(oldAt); String inverseAttributeName = null; JavaPersistentType inverseJPT = null; @@ -1253,11 +1253,11 @@ public class JpaArtifactFactory { } - private void renameMapsIdAnnotationValue(JavaModifiablePersistentAttribute oldAt, - JavaModifiablePersistentAttribute newAt, HashSet<JavaPersistentType> embeddingEntities) { + private void renameMapsIdAnnotationValue(JavaSpecifiedPersistentAttribute oldAt, + JavaSpecifiedPersistentAttribute newAt, HashSet<JavaPersistentType> embeddingEntities) { for(JavaPersistentType embeddingEntity : embeddingEntities){ - for(JavaModifiablePersistentAttribute attr : embeddingEntity.getAttributes()){ + for(JavaSpecifiedPersistentAttribute 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(JavaModifiablePersistentAttribute persistentAttribite, Annotation an, + private IRelation produceRelation(JavaSpecifiedPersistentAttribute persistentAttribite, Annotation an, JavaPersistentType relJPT, IJPAEditorFeatureProvider fp) { - Hashtable<JavaModifiablePersistentAttribute, Annotation> ht = getRelAttributeAnnotation( + Hashtable<JavaSpecifiedPersistentAttribute, Annotation> ht = getRelAttributeAnnotation( persistentAttribite, relJPT, fp); if (ht == null) { return produceUniDirRelation((JavaPersistentType)persistentAttribite .getParent(), persistentAttribite, an, relJPT, fp); } else { - JavaModifiablePersistentAttribute relAt = ht.keys().nextElement(); + JavaSpecifiedPersistentAttribute 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(JavaModifiablePersistentAttribute embeddingAttribute, Annotation an, + private HasReferanceRelation produceEmbeddedRelation(JavaSpecifiedPersistentAttribute 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<JavaModifiablePersistentAttribute, Annotation> getRelAttributeAnnotation( - JavaModifiablePersistentAttribute jpa, JavaPersistentType relJPT, IJPAEditorFeatureProvider fp) { + private Hashtable<JavaSpecifiedPersistentAttribute, Annotation> getRelAttributeAnnotation( + JavaSpecifiedPersistentAttribute jpa, JavaPersistentType relJPT, IJPAEditorFeatureProvider fp) { JavaPersistentType jpt = (JavaPersistentType)jpa.getParent(); - for (JavaModifiablePersistentAttribute relEntAt : relJPT.getAttributes()) { + for (JavaSpecifiedPersistentAttribute 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<JavaModifiablePersistentAttribute, Annotation> ht = new Hashtable<JavaModifiablePersistentAttribute, Annotation>(); + Hashtable<JavaSpecifiedPersistentAttribute, Annotation> ht = new Hashtable<JavaSpecifiedPersistentAttribute, 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, - JavaModifiablePersistentAttribute relEntAt, Annotation an, String[] mappedByStrings) { + JavaSpecifiedPersistentAttribute relEntAt, Annotation an, String[] mappedByStrings) { String mappedBy = mappedByStrings[0]; JavaPersistentType involvedEntity = findJPT(relEntAt, fp, an); - JavaModifiablePersistentAttribute embeddedAttribute = involvedEntity.getAttributeNamed(mappedBy); + JavaSpecifiedPersistentAttribute 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, JavaModifiablePersistentAttribute at, Annotation an, + JavaPersistentType jpt, JavaSpecifiedPersistentAttribute 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, JavaModifiablePersistentAttribute at, + JavaPersistentType jpt, JavaSpecifiedPersistentAttribute 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, - JavaModifiablePersistentAttribute at, Annotation an, - JavaPersistentType relJPT, JavaModifiablePersistentAttribute relAt, + JavaSpecifiedPersistentAttribute at, Annotation an, + JavaPersistentType relJPT, JavaSpecifiedPersistentAttribute 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(JavaModifiablePersistentAttribute attr) { + public boolean isMethodAnnotated(JavaSpecifiedPersistentAttribute attr) { return attr.getResourceAttribute().getAstNodeType() == AstNodeType.METHOD; } public boolean isMethodAnnotated(JavaPersistentType jpt) { - ListIterator<JavaModifiablePersistentAttribute> li = jpt.getAttributes().iterator(); + ListIterator<JavaSpecifiedPersistentAttribute> 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(); - JavaModifiablePersistentAttribute[] ids = getIds(jpt); + JavaSpecifiedPersistentAttribute[] 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 JavaModifiablePersistentAttribute[] getIds(JavaPersistentType jpt) { - ArrayList<JavaModifiablePersistentAttribute> res = new ArrayList<JavaModifiablePersistentAttribute>(); - for (JavaModifiablePersistentAttribute at : jpt.getAttributes()) { + public JavaSpecifiedPersistentAttribute[] getIds(JavaPersistentType jpt) { + ArrayList<JavaSpecifiedPersistentAttribute> res = new ArrayList<JavaSpecifiedPersistentAttribute>(); + for (JavaSpecifiedPersistentAttribute at : jpt.getAttributes()) { if (isId(at)) { res.add(at); } } - JavaModifiablePersistentAttribute[] ret = new JavaModifiablePersistentAttribute[res.size()]; + JavaSpecifiedPersistentAttribute[] ret = new JavaSpecifiedPersistentAttribute[res.size()]; return res.toArray(ret); } @@ -1821,13 +1821,13 @@ public class JpaArtifactFactory { } public boolean hasPrimaryKey(JavaPersistentType jpt) { - for (JavaModifiablePersistentAttribute at : jpt.getAttributes()) + for (JavaSpecifiedPersistentAttribute at : jpt.getAttributes()) if (isId(at)) return true; return false; } private boolean hasSimplePk(JavaPersistentType jpt) { - for(JavaModifiablePersistentAttribute at : jpt.getAttributes()){ + for(JavaSpecifiedPersistentAttribute at : jpt.getAttributes()){ if(isSimpleId(at) && !hasIDClassAnnotation(jpt)){ return true; } @@ -1835,8 +1835,8 @@ public class JpaArtifactFactory { return false; } - private JavaModifiablePersistentAttribute getSimplePkAttribute(JavaPersistentType jpt){ - for(JavaModifiablePersistentAttribute jpa : jpt.getAttributes()){ + private JavaSpecifiedPersistentAttribute getSimplePkAttribute(JavaPersistentType jpt){ + for(JavaSpecifiedPersistentAttribute jpa : jpt.getAttributes()){ if(isSimpleId(jpa)){ return jpa; } @@ -1853,7 +1853,7 @@ public class JpaArtifactFactory { } private boolean hasEmbeddedPk(JavaPersistentType jpt){ - for(JavaModifiablePersistentAttribute at : jpt.getAttributes()){ + for(JavaSpecifiedPersistentAttribute at : jpt.getAttributes()){ if(isEmbeddedId(at)){ return true; } @@ -1861,8 +1861,8 @@ public class JpaArtifactFactory { return false; } - private JavaModifiablePersistentAttribute getEmbeddedIdAttribute(JavaPersistentType jpt){ - for(JavaModifiablePersistentAttribute jpa : jpt.getAttributes()){ + private JavaSpecifiedPersistentAttribute getEmbeddedIdAttribute(JavaPersistentType jpt){ + for(JavaSpecifiedPersistentAttribute 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(JavaModifiablePersistentAttribute jpa) { + public boolean isEmbeddedAttribute(JavaSpecifiedPersistentAttribute jpa) { return (jpa.getMappingKey() == MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY); } - public String getColumnName(JavaModifiablePersistentAttribute jpa) { + public String getColumnName(JavaSpecifiedPersistentAttribute 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, JavaModifiablePersistentAttribute ownerAttr) { + public void calculateDerivedIdAnnotation(JavaPersistentType ownerJPT, JavaPersistentType inverseJPT, JavaSpecifiedPersistentAttribute ownerAttr) { String attributeType = null; if(hasSimplePk(inverseJPT)){ - JavaModifiablePersistentAttribute jpa = getSimplePkAttribute(inverseJPT); + JavaSpecifiedPersistentAttribute 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, JavaModifiablePersistentAttribute ownerAttr, + JavaPersistentType inverseJPT, JavaSpecifiedPersistentAttribute 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, JavaModifiablePersistentAttribute ownerAttr, + JavaPersistentType inverseJPT, JavaSpecifiedPersistentAttribute 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, - JavaModifiablePersistentAttribute ownerAttr, String fqnClass, String attributeTypeName) { + JavaSpecifiedPersistentAttribute 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()){ diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/AddAttributeFeatureTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/AddAttributeFeatureTest.java index fa21b55b27..932ec7d2a2 100644 --- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/AddAttributeFeatureTest.java +++ b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/AddAttributeFeatureTest.java @@ -36,7 +36,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.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.AddAttributeFeature; import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider; import org.junit.Before; @@ -48,7 +48,7 @@ public class AddAttributeFeatureTest { private AddContext context; - private JavaModifiablePersistentAttribute jpa; + private JavaSpecifiedPersistentAttribute jpa; private ContainerShape entityShape; @@ -62,7 +62,7 @@ public class AddAttributeFeatureTest { @Before public void setUp() throws Exception { featureProvider = EasyMock.createMock(IJPAEditorFeatureProvider.class); - jpa = EasyMock.createMock(JavaModifiablePersistentAttribute.class); + jpa = EasyMock.createMock(JavaSpecifiedPersistentAttribute.class); context = new AddContext(); context.setNewObject(jpa); context.setTargetContainer(entityShape); diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/CreateRelationFeaturesTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/CreateRelationFeaturesTest.java index 1423b87821..c1bb10a536 100644 --- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/CreateRelationFeaturesTest.java +++ b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/CreateRelationFeaturesTest.java @@ -34,7 +34,7 @@ import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType; import org.eclipse.jpt.jpa.core.JpaProject; -import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType; import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.CreateManyToManyBiDirRelationFeature; import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.CreateManyToManyUniDirRelationFeature; @@ -143,7 +143,7 @@ public class CreateRelationFeaturesTest { assertSame(rel.getInverse(), t2); assertNotNull(t1.getAttributeNamed(rel.getOwnerAttributeName())); assertTrue(JpaArtifactFactory.instance().isMethodAnnotated(t1)); - JavaModifiablePersistentAttribute jpa = t1.getAttributeNamed("id"); + JavaSpecifiedPersistentAttribute jpa = t1.getAttributeNamed("id"); assertFalse(isRelationAnnotated(jpa)); jpa = t1.getAttributeNamed(rel.getOwnerAttributeName()); assertTrue(isRelationAnnotated(jpa)); @@ -549,7 +549,7 @@ public class CreateRelationFeaturesTest { return JavaCore.createCompilationUnitFrom(file); } - private boolean isRelationAnnotated(JavaModifiablePersistentAttribute jpa) { + private boolean isRelationAnnotated(JavaSpecifiedPersistentAttribute jpa) { HashSet<String> anNames = JpaArtifactFactory.instance().getAnnotationNames(jpa); Iterator<String> it = anNames.iterator(); diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/DirectEditAttributeFeatureTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/DirectEditAttributeFeatureTest.java index cf11799e99..c62e9361df 100644 --- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/DirectEditAttributeFeatureTest.java +++ b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/DirectEditAttributeFeatureTest.java @@ -27,7 +27,7 @@ import org.eclipse.graphiti.features.IDirectEditingFeature; import org.eclipse.graphiti.features.IFeatureProvider; import org.eclipse.graphiti.features.context.IDirectEditingContext; import org.eclipse.jdt.core.JavaConventions; -import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType; import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.DirectEditAttributeFeature; import org.eclipse.jpt.jpadiagrameditor.ui.internal.i18n.JPAEditorMessages; @@ -48,7 +48,7 @@ public class DirectEditAttributeFeatureTest { @Test public void testCheckValueValidStringByJavaConventions() { JavaPersistentType jpt = EasyMock.createNiceMock(JavaPersistentType.class); - JavaModifiablePersistentAttribute jpa = configureJpaForJpt(jpt); + JavaSpecifiedPersistentAttribute jpa = configureJpaForJpt(jpt); expect(jpt.getAttributeNamed(isA(String.class))).andStubReturn(jpa); replay(jpa, jpt); @@ -65,11 +65,11 @@ public class DirectEditAttributeFeatureTest { @Test public void testCheckValueValidStringDuplicateAttribute() { - JavaModifiablePersistentAttribute otherJpa = EasyMock.createMock(JavaModifiablePersistentAttribute.class); + JavaSpecifiedPersistentAttribute otherJpa = EasyMock.createMock(JavaSpecifiedPersistentAttribute.class); JavaPersistentType jpt = EasyMock.createMock(JavaPersistentType.class); expect(jpt.getAttributeNamed("attrName")).andStubReturn(otherJpa); - JavaModifiablePersistentAttribute jpa = configureJpaForJpt(jpt); + JavaSpecifiedPersistentAttribute jpa = configureJpaForJpt(jpt); replay(jpa, jpt, otherJpa); IFeatureProvider provider = replayJpaForNullPe(jpa); @@ -80,15 +80,15 @@ public class DirectEditAttributeFeatureTest { assertEquals(MessageFormat.format(JPAEditorMessages.DirectEditAttributeFeature_attributeExists, "attrName"), feature.checkValueValid("attrName", context)); } - private IFeatureProvider replayJpaForNullPe(JavaModifiablePersistentAttribute jpa) { + private IFeatureProvider replayJpaForNullPe(JavaSpecifiedPersistentAttribute jpa) { IFeatureProvider provider = EasyMock.createMock(IJPAEditorFeatureProvider.class); expect(provider.getBusinessObjectForPictogramElement(null)).andStubReturn(jpa); replay(provider); return provider; } - private JavaModifiablePersistentAttribute configureJpaForJpt(JavaPersistentType jpt) { - JavaModifiablePersistentAttribute jpa = EasyMock.createMock(JavaModifiablePersistentAttribute.class); + private JavaSpecifiedPersistentAttribute configureJpaForJpt(JavaPersistentType jpt) { + JavaSpecifiedPersistentAttribute jpa = EasyMock.createMock(JavaSpecifiedPersistentAttribute.class); expect(jpa.getParent()).andStubReturn(jpt); return jpa; } diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/RefactorAttributeTypeFeatureTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/RefactorAttributeTypeFeatureTest.java index af5e891a82..3ee7135713 100644 --- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/RefactorAttributeTypeFeatureTest.java +++ b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/RefactorAttributeTypeFeatureTest.java @@ -29,7 +29,7 @@ import org.eclipse.core.resources.IFile; import org.eclipse.graphiti.features.context.ICustomContext; import org.eclipse.graphiti.mm.pictograms.PictogramElement; import org.eclipse.jpt.jpa.core.JpaProject; -import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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.feature.RefactorAttributeTypeFeature; @@ -84,7 +84,7 @@ public class RefactorAttributeTypeFeatureTest { public void testAttributeUtils(){ PersistenceUnit pu = JpaArtifactFactory.instance().getPersistenceUnit(jpaProject); JavaPersistentType jpt = (JavaPersistentType)pu.getPersistentType("org.eclipse.Ent"); - JavaModifiablePersistentAttribute at = jpt.getAttributeNamed("id"); + JavaSpecifiedPersistentAttribute at = jpt.getAttributeNamed("id"); List<String> lst = JpaArtifactFactory.instance().getAnnotationStrings(at); assertEquals(1, lst.size()); assertTrue(lst.contains("@Id")); diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/RemoveAttributeFeatureTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/RemoveAttributeFeatureTest.java index c71f1c7b81..a1fcf4aea2 100644 --- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/RemoveAttributeFeatureTest.java +++ b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/feature/RemoveAttributeFeatureTest.java @@ -37,7 +37,7 @@ import org.eclipse.graphiti.mm.pictograms.Anchor; import org.eclipse.graphiti.mm.pictograms.ContainerShape; import org.eclipse.graphiti.mm.pictograms.Shape; import org.eclipse.jpt.jpa.core.JpaProject; -import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.RemoveAttributeFeature; import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider; import org.eclipse.jpt.jpadiagrameditor.ui.tests.internal.JPACreateFactory; @@ -96,7 +96,7 @@ public class RemoveAttributeFeatureTest { expect(featureProvider.decreaseAttribsNum(pictogramElement)).andReturn(0); expect(featureProvider.getKeyForBusinessObject(isA(Object.class))).andReturn(""); expect(featureProvider.remove("")).andReturn(null); - expect(featureProvider.getRelationRelatedToAttribute(isA(JavaModifiablePersistentAttribute.class))).andReturn(null); + expect(featureProvider.getRelationRelatedToAttribute(isA(JavaSpecifiedPersistentAttribute.class))).andReturn(null); replay(featureProvider); context = EasyMock.createMock(IRemoveContext.class); diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/provider/JPAEditorFeatureProviderTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/provider/JPAEditorFeatureProviderTest.java index bcfa5c3147..85ec90c9e3 100644 --- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/provider/JPAEditorFeatureProviderTest.java +++ b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/provider/JPAEditorFeatureProviderTest.java @@ -30,7 +30,7 @@ import org.eclipse.graphiti.features.IDeleteFeature; import org.eclipse.graphiti.features.context.IDeleteContext; import org.eclipse.graphiti.mm.Property; import org.eclipse.graphiti.mm.pictograms.PictogramElement; -import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType; import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.ClickRemoveAttributeButtonFeature; import org.eclipse.jpt.jpadiagrameditor.ui.internal.feature.DeleteJPAEntityFeature; @@ -73,7 +73,7 @@ public class JPAEditorFeatureProviderTest { @Test public void testAttributeDeleteFeature(){ PictogramElement pe = replayPictogramElement(); - JavaModifiablePersistentAttribute jpa = replayAttribute(); + JavaSpecifiedPersistentAttribute jpa = replayAttribute(); expect(solver.getBusinessObjectForKey(businessObjectKey)).andStubReturn(jpa); IJPAEditorFeatureProvider provider = createFeatureProvider(); @@ -123,8 +123,8 @@ public class JPAEditorFeatureProviderTest { return jpt; } - private JavaModifiablePersistentAttribute replayAttribute(){ - JavaModifiablePersistentAttribute attribute = EasyMock.createMock(JavaModifiablePersistentAttribute.class); + private JavaSpecifiedPersistentAttribute replayAttribute(){ + JavaSpecifiedPersistentAttribute attribute = EasyMock.createMock(JavaSpecifiedPersistentAttribute.class); expect(attribute.getName()).andReturn("attribute"); replay(attribute); return attribute; diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/provider/JPAEditorToolBehaviorProviderTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/provider/JPAEditorToolBehaviorProviderTest.java index f3f1f1a72d..97049b8156 100644 --- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/provider/JPAEditorToolBehaviorProviderTest.java +++ b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/provider/JPAEditorToolBehaviorProviderTest.java @@ -34,7 +34,7 @@ import org.eclipse.graphiti.mm.pictograms.PictogramElement; import org.eclipse.graphiti.tb.IDecorator; import org.eclipse.graphiti.tb.IToolBehaviorProvider; import org.eclipse.graphiti.tb.ImageDecorator; -import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType; import org.eclipse.jpt.jpadiagrameditor.ui.internal.modelintegration.ui.JPAEditorMatchingStrategy; import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.JPAEditorToolBehaviorProvider; @@ -155,7 +155,7 @@ public class JPAEditorToolBehaviorProviderTest { public void testGetDoubleClickOnJpaFeature() throws Exception { PictogramElement pe = replayPictogramElement(100, 100); IFile file = replayResource(); - JavaModifiablePersistentAttribute jpa = replayJpa(pe, file); + JavaSpecifiedPersistentAttribute jpa = replayJpa(pe, file); IDiagramTypeProvider dtp = replayDiagramProviderForJpa(pe, jpa); IEclipseFacade eclipseFacade = EasyMock.createMock(IEclipseFacade.class); @@ -222,16 +222,16 @@ public class JPAEditorToolBehaviorProviderTest { return jpt; } - private JavaModifiablePersistentAttribute replayJpa(PictogramElement pe, IFile file){ + private JavaSpecifiedPersistentAttribute replayJpa(PictogramElement pe, IFile file){ IFeatureProvider featureProvider = EasyMock.createMock(IFeatureProvider.class); - JavaModifiablePersistentAttribute jpa = EasyMock.createMock(JavaModifiablePersistentAttribute.class); + JavaSpecifiedPersistentAttribute jpa = EasyMock.createMock(JavaSpecifiedPersistentAttribute.class); expect(featureProvider.getBusinessObjectForPictogramElement(pe)).andStubReturn(jpa); expect(jpa.getResource()).andReturn(file); replay(jpa, featureProvider); return jpa; } - private IDiagramTypeProvider replayDiagramProviderForJpa(PictogramElement pe, JavaModifiablePersistentAttribute jpa) { + private IDiagramTypeProvider replayDiagramProviderForJpa(PictogramElement pe, JavaSpecifiedPersistentAttribute jpa) { IFeatureProvider featureProvider = EasyMock.createMock(IFeatureProvider.class); expect(featureProvider.getBusinessObjectForPictogramElement(pe)).andStubReturn(jpa); IDiagramTypeProvider dtp = EasyMock.createMock(IDiagramTypeProvider.class); diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationAttributesTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationAttributesTest.java index 921c04f13e..de62c5a971 100644 --- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationAttributesTest.java +++ b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationAttributesTest.java @@ -33,7 +33,7 @@ import org.eclipse.jpt.jpa.core.context.java.JavaManyToManyMapping; import org.eclipse.jpt.jpa.core.context.java.JavaManyToOneMapping; import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping; import org.eclipse.jpt.jpa.core.context.java.JavaOneToOneMapping; -import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; 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.provider.IJPAEditorFeatureProvider; @@ -107,7 +107,7 @@ public class CreateRelationAttributesTest { t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); } - JavaModifiablePersistentAttribute attr = JpaArtifactFactory.instance(). + JavaSpecifiedPersistentAttribute attr = JpaArtifactFactory.instance(). addAttribute(featureProvider, (JavaPersistentType)t1, (JavaPersistentType)t2, null, "add", "add", false, createCompilationUnitFrom(customerFile)); jpaProject.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor()); @@ -149,7 +149,7 @@ public class CreateRelationAttributesTest { t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName()); } - JavaModifiablePersistentAttribute attr = JpaArtifactFactory.instance(). + JavaSpecifiedPersistentAttribute attr = JpaArtifactFactory.instance(). addAttribute(featureProvider, (JavaPersistentType)t1, (JavaPersistentType)t2, null, "address", "address", false, createCompilationUnitFrom((IFile)t1.getResource())); assertNotNull(attr); @@ -199,12 +199,12 @@ public class CreateRelationAttributesTest { t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, creditCardType.getTypeBinding().getQualifiedName()); } - JavaModifiablePersistentAttribute attr = JpaArtifactFactory.instance(). + JavaSpecifiedPersistentAttribute attr = JpaArtifactFactory.instance(). addAttribute( featureProvider, (JavaPersistentType)t1, (JavaPersistentType)t2, null, "creditCard", "creditCard", false, createCompilationUnitFrom((IFile)t1.getResource())); assertNotNull(attr); - JavaModifiablePersistentAttribute attr2 = JpaArtifactFactory.instance(). + JavaSpecifiedPersistentAttribute attr2 = JpaArtifactFactory.instance(). addAttribute(featureProvider, (JavaPersistentType)t2, (JavaPersistentType)t1, null, "customer", "customer", false, createCompilationUnitFrom((IFile)t2.getResource())); assertNotNull(attr2); @@ -219,7 +219,7 @@ public class CreateRelationAttributesTest { PersistentAttribute ownerPersistentAttribute = ownerPersistentType.resolveAttribute("creditCard"); assertNotNull(ownerPersistentAttribute); - assertTrue(ownerPersistentAttribute instanceof JavaModifiablePersistentAttribute); + assertTrue(ownerPersistentAttribute instanceof JavaSpecifiedPersistentAttribute); AttributeMapping ownerSideMapping = ownerPersistentAttribute.getMapping(); assertTrue(ownerSideMapping instanceof JavaOneToOneMapping); @@ -234,7 +234,7 @@ public class CreateRelationAttributesTest { PersistentAttribute inversePersistentAttribute = inversePersistentType.resolveAttribute("customer"); assertNotNull(inversePersistentAttribute); - assertTrue(inversePersistentAttribute instanceof JavaModifiablePersistentAttribute); + assertTrue(inversePersistentAttribute instanceof JavaSpecifiedPersistentAttribute); AttributeMapping inverseSideMapping = inversePersistentAttribute.getMapping(); assertTrue(inverseSideMapping instanceof JavaOneToOneMapping); @@ -274,7 +274,7 @@ public class CreateRelationAttributesTest { t2 = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, phoneType.getTypeBinding().getQualifiedName()); } - JavaModifiablePersistentAttribute attr = JpaArtifactFactory.instance().addAttribute(featureProvider, (JavaPersistentType)t1, (JavaPersistentType)t2, null, "phones", "phones", true, + JavaSpecifiedPersistentAttribute attr = JpaArtifactFactory.instance().addAttribute(featureProvider, (JavaPersistentType)t1, (JavaPersistentType)t2, null, "phones", "phones", true, createCompilationUnitFrom((IFile)t1.getResource())); assertNotNull(attr); @@ -327,12 +327,12 @@ public class CreateRelationAttributesTest { manySidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getTypeBinding().getQualifiedName()); } - JavaModifiablePersistentAttribute singleSideAttribute = JpaArtifactFactory.instance(). + JavaSpecifiedPersistentAttribute singleSideAttribute = JpaArtifactFactory.instance(). addAttribute(featureProvider, (JavaPersistentType)singleSidePersistentType, (JavaPersistentType)manySidePersistentType, null, "reservations", "reservations", true, createCompilationUnitFrom((IFile)singleSidePersistentType.getResource())); assertNotNull(singleSideAttribute); - JavaModifiablePersistentAttribute manySideAttribute = JpaArtifactFactory.instance(). + JavaSpecifiedPersistentAttribute manySideAttribute = JpaArtifactFactory.instance(). addAttribute(featureProvider, (JavaPersistentType)manySidePersistentType, (JavaPersistentType)singleSidePersistentType, null, "cruise", "cruise", false, createCompilationUnitFrom((IFile)manySidePersistentType.getResource())); assertNotNull(manySideAttribute); @@ -348,7 +348,7 @@ public class CreateRelationAttributesTest { PersistentAttribute inversePersistentAttribute = inversePersistentType.resolveAttribute("reservations"); assertNotNull(inversePersistentAttribute); - assertTrue(inversePersistentAttribute instanceof JavaModifiablePersistentAttribute); + assertTrue(inversePersistentAttribute instanceof JavaSpecifiedPersistentAttribute); AttributeMapping inverseSideMapping = inversePersistentAttribute.getMapping(); assertTrue(inverseSideMapping instanceof JavaOneToManyMapping); @@ -374,7 +374,7 @@ public class CreateRelationAttributesTest { } assertNotNull(ownerPersistentAttribute); - assertTrue(ownerPersistentAttribute instanceof JavaModifiablePersistentAttribute); + assertTrue(ownerPersistentAttribute instanceof JavaSpecifiedPersistentAttribute); AttributeMapping ownerSideMapping = ownerPersistentAttribute.getMapping(); c = 0; @@ -420,7 +420,7 @@ public class CreateRelationAttributesTest { singleSidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, shipType.getTypeBinding().getQualifiedName()); } - JavaModifiablePersistentAttribute mappedAttribute = JpaArtifactFactory.instance(). + JavaSpecifiedPersistentAttribute mappedAttribute = JpaArtifactFactory.instance(). addAttribute(featureProvider, (JavaPersistentType)manySidePersistentType, (JavaPersistentType)singleSidePersistentType, null, "ship", "ship", true, createCompilationUnitFrom((IFile)manySidePersistentType.getResource())); assertNotNull(mappedAttribute); @@ -485,12 +485,12 @@ public class CreateRelationAttributesTest { inverseSidePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName()); } - JavaModifiablePersistentAttribute ownerSideAttribute = JpaArtifactFactory.instance(). + JavaSpecifiedPersistentAttribute ownerSideAttribute = JpaArtifactFactory.instance(). addAttribute(featureProvider, (JavaPersistentType)ownerSidePersistentType, (JavaPersistentType)inverseSidePersistentType, null, "customers", "customers", true, createCompilationUnitFrom((IFile)ownerSidePersistentType.getResource())); assertNotNull(ownerSideAttribute); - JavaModifiablePersistentAttribute inverseSideAttributes = JpaArtifactFactory.instance().addAttribute(featureProvider, (JavaPersistentType)inverseSidePersistentType, (JavaPersistentType)ownerSidePersistentType, null, "reservations", "reservations", true, + JavaSpecifiedPersistentAttribute inverseSideAttributes = JpaArtifactFactory.instance().addAttribute(featureProvider, (JavaPersistentType)inverseSidePersistentType, (JavaPersistentType)ownerSidePersistentType, null, "reservations", "reservations", true, createCompilationUnitFrom((IFile)inverseSidePersistentType.getResource())); assertNotNull(inverseSideAttributes); @@ -504,7 +504,7 @@ public class CreateRelationAttributesTest { PersistentAttribute ownerPersistentAttribute = ownerPersistentType.resolveAttribute("customers"); assertNotNull(ownerPersistentAttribute); - assertTrue(ownerPersistentAttribute instanceof JavaModifiablePersistentAttribute); + assertTrue(ownerPersistentAttribute instanceof JavaSpecifiedPersistentAttribute); AttributeMapping ownerSideMapping = ownerPersistentAttribute.getMapping(); assertTrue(ownerSideMapping instanceof JavaManyToManyMapping); @@ -519,7 +519,7 @@ public class CreateRelationAttributesTest { PersistentAttribute inversePersistentAttribute = inversePersistentType.resolveAttribute("reservations"); assertNotNull(inversePersistentAttribute); - assertTrue(inversePersistentAttribute instanceof JavaModifiablePersistentAttribute); + assertTrue(inversePersistentAttribute instanceof JavaSpecifiedPersistentAttribute); AttributeMapping inverseSideMapping = inversePersistentAttribute.getMapping(); assertTrue(inverseSideMapping instanceof JavaManyToManyMapping); @@ -556,7 +556,7 @@ public class CreateRelationAttributesTest { referencedPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, cabinType.getTypeBinding().getQualifiedName()); } - JavaModifiablePersistentAttribute annotatedSideAttribute = JpaArtifactFactory.instance(). + JavaSpecifiedPersistentAttribute annotatedSideAttribute = JpaArtifactFactory.instance(). addAttribute(featureProvider, (JavaPersistentType)annotatedPersistentType, (JavaPersistentType)referencedPersistentType, null, "cabins", "cabins", true, createCompilationUnitFrom((IFile)annotatedPersistentType.getResource())); assertNotNull(annotatedSideAttribute); @@ -571,7 +571,7 @@ public class CreateRelationAttributesTest { PersistentAttribute persistentAttribute = persistentType.resolveAttribute("cabins"); assertNotNull(persistentAttribute); - assertTrue(persistentAttribute instanceof JavaModifiablePersistentAttribute); + assertTrue(persistentAttribute instanceof JavaSpecifiedPersistentAttribute); AttributeMapping mapping = persistentAttribute.getMapping(); assertTrue(mapping instanceof JavaManyToManyMapping); diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationsInFieldAnnotatedEntitiesTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationsInFieldAnnotatedEntitiesTest.java index cde9e0207d..9d11ef5adf 100644 --- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationsInFieldAnnotatedEntitiesTest.java +++ b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationsInFieldAnnotatedEntitiesTest.java @@ -28,7 +28,7 @@ import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType; import org.eclipse.jpt.jpa.core.JpaProject; -import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType; import org.eclipse.jpt.jpa.core.resource.java.OwnableRelationshipMappingAnnotation; import org.eclipse.jpt.jpadiagrameditor.ui.internal.provider.IJPAEditorFeatureProvider; @@ -109,7 +109,7 @@ public class CreateRelationsInFieldAnnotatedEntitiesTest { assertSame(t1, rel.getOwner()); assertSame(t2, rel.getInverse()); assertEquals("address", rel.getOwnerAttributeName()); - JavaModifiablePersistentAttribute ownerAt = t1.getAttributeNamed("address"); + JavaSpecifiedPersistentAttribute ownerAt = t1.getAttributeNamed("address"); assertNotNull(ownerAt); Set<String> annotations = JpaArtifactFactory.instance().getAnnotationNames(ownerAt); assertTrue(annotations.contains("OneToOne")); @@ -159,13 +159,13 @@ public class CreateRelationsInFieldAnnotatedEntitiesTest { assertSame(t1, rel.getOwner()); assertSame(t2, rel.getInverse()); assertEquals("address", rel.getOwnerAttributeName()); - JavaModifiablePersistentAttribute ownerAt = t1.getAttributeNamed("address"); + JavaSpecifiedPersistentAttribute ownerAt = t1.getAttributeNamed("address"); assertNotNull(ownerAt); Set<String> annotations = JpaArtifactFactory.instance().getAnnotationNames(ownerAt); assertTrue(annotations.contains("OneToOne")); assertNull(((OwnableRelationshipMappingAnnotation)ownerAt.getMapping()).getMappedBy()); - JavaModifiablePersistentAttribute inverseAt = t2.getAttributeNamed("customer"); + JavaSpecifiedPersistentAttribute inverseAt = t2.getAttributeNamed("customer"); assertNotNull(inverseAt); annotations = JpaArtifactFactory.instance().getAnnotationNames(inverseAt); assertTrue(annotations.contains("OneToOne")); @@ -219,7 +219,7 @@ public class CreateRelationsInFieldAnnotatedEntitiesTest { assertSame(t1, rel.getOwner()); assertSame(t2, rel.getInverse()); assertEquals("address", rel.getOwnerAttributeName()); - JavaModifiablePersistentAttribute ownerAt = t1.getAttributeNamed("address"); + JavaSpecifiedPersistentAttribute ownerAt = t1.getAttributeNamed("address"); assertNotNull(ownerAt); Set<String> annotations = JpaArtifactFactory.instance().getAnnotationNames(ownerAt); assertTrue(annotations.contains("OneToMany")); @@ -269,7 +269,7 @@ public class CreateRelationsInFieldAnnotatedEntitiesTest { assertSame(t1, rel.getOwner()); assertSame(t2, rel.getInverse()); assertEquals("address", rel.getOwnerAttributeName()); - JavaModifiablePersistentAttribute ownerAt = t1.getAttributeNamed("address"); + JavaSpecifiedPersistentAttribute ownerAt = t1.getAttributeNamed("address"); assertNotNull(ownerAt); Set<String> annotations = JpaArtifactFactory.instance().getAnnotationNames(ownerAt); assertTrue(annotations.contains("ManyToOne")); @@ -320,12 +320,12 @@ public class CreateRelationsInFieldAnnotatedEntitiesTest { assertSame(t1, rel.getOwner()); assertSame(t2, rel.getInverse()); assertEquals("address", rel.getOwnerAttributeName()); - JavaModifiablePersistentAttribute ownerAt = t1.getAttributeNamed("address"); + JavaSpecifiedPersistentAttribute ownerAt = t1.getAttributeNamed("address"); assertNotNull(ownerAt); Set<String> annotations = JpaArtifactFactory.instance().getAnnotationNames(ownerAt); assertTrue(annotations.contains("ManyToOne")); - JavaModifiablePersistentAttribute inverseAt = t2.getAttributeNamed("customer"); + JavaSpecifiedPersistentAttribute inverseAt = t2.getAttributeNamed("customer"); assertNotNull(inverseAt); annotations = JpaArtifactFactory.instance().getAnnotationNames(inverseAt); assertTrue(annotations.contains("OneToMany")); @@ -379,7 +379,7 @@ public class CreateRelationsInFieldAnnotatedEntitiesTest { assertSame(t1, rel.getOwner()); assertSame(t2, rel.getInverse()); assertEquals("address", rel.getOwnerAttributeName()); - JavaModifiablePersistentAttribute ownerAt = t1.getAttributeNamed("address"); + JavaSpecifiedPersistentAttribute ownerAt = t1.getAttributeNamed("address"); assertNotNull(ownerAt); Set<String> annotations = JpaArtifactFactory.instance().getAnnotationNames(ownerAt); assertTrue(annotations.contains("ManyToMany")); @@ -430,13 +430,13 @@ public class CreateRelationsInFieldAnnotatedEntitiesTest { assertSame(t1, rel.getOwner()); assertSame(t2, rel.getInverse()); assertEquals("address", rel.getOwnerAttributeName()); - JavaModifiablePersistentAttribute ownerAt = t1.getAttributeNamed("address"); + JavaSpecifiedPersistentAttribute ownerAt = t1.getAttributeNamed("address"); assertNotNull(ownerAt); Set<String> annotations = JpaArtifactFactory.instance().getAnnotationNames(ownerAt); assertTrue(annotations.contains("ManyToMany")); assertNull(((OwnableRelationshipMappingAnnotation)ownerAt.getMapping()).getMappedBy()); - JavaModifiablePersistentAttribute inverseAt = t2.getAttributeNamed("customer"); + JavaSpecifiedPersistentAttribute inverseAt = t2.getAttributeNamed("customer"); assertNotNull(inverseAt); annotations = JpaArtifactFactory.instance().getAnnotationNames(inverseAt); assertTrue(annotations.contains("ManyToMany")); diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationsTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationsTest.java index 3931c0f55e..efb1f7d87a 100644 --- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationsTest.java +++ b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationsTest.java @@ -32,7 +32,7 @@ import org.eclipse.jpt.common.utility.internal.iterable.SubIterableWrapper; import org.eclipse.jpt.jpa.core.JpaProject; import org.eclipse.jpt.jpa.core.context.AttributeMapping; import org.eclipse.jpt.jpa.core.context.Embeddable; -import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType; import org.eclipse.jpt.jpa.core.resource.java.JPA; import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation; @@ -144,7 +144,7 @@ public class CreateRelationsTest { assertSame(t1, rel.getOwner()); assertSame(t2, rel.getInverse()); assertEquals("address", rel.getOwnerAttributeName()); - JavaModifiablePersistentAttribute ownerAt = t1.getAttributeNamed("address"); + JavaSpecifiedPersistentAttribute ownerAt = t1.getAttributeNamed("address"); assertNotNull(ownerAt); OneToOneAnnotation an = (OneToOneAnnotation)ownerAt.getResourceAttribute().getAnnotation(OneToOneAnnotation.ANNOTATION_NAME); assertNotNull(an); @@ -160,13 +160,13 @@ public class CreateRelationsTest { assertSame(t1, rel.getOwner()); assertSame(t2, rel.getInverse()); assertEquals("address", rel.getOwnerAttributeName()); - JavaModifiablePersistentAttribute ownerAt = t1.getAttributeNamed("address"); + JavaSpecifiedPersistentAttribute ownerAt = t1.getAttributeNamed("address"); assertNotNull(ownerAt); OneToOneAnnotation an = (OneToOneAnnotation)ownerAt.getResourceAttribute().getAnnotation(OneToOneAnnotation.ANNOTATION_NAME); assertNotNull(an); assertNull(an.getMappedBy()); - JavaModifiablePersistentAttribute inverseAt = t2.getAttributeNamed("customer"); + JavaSpecifiedPersistentAttribute inverseAt = t2.getAttributeNamed("customer"); assertNotNull(inverseAt); an = (OneToOneAnnotation)inverseAt.getResourceAttribute().getAnnotation(OneToOneAnnotation.ANNOTATION_NAME); assertNotNull(an); @@ -182,7 +182,7 @@ public class CreateRelationsTest { assertSame(t1, rel.getOwner()); assertSame(t2, rel.getInverse()); assertEquals("address", rel.getOwnerAttributeName()); - JavaModifiablePersistentAttribute ownerAt = t1.getAttributeNamed("address"); + JavaSpecifiedPersistentAttribute ownerAt = t1.getAttributeNamed("address"); assertNotNull(ownerAt); OneToManyAnnotation an = (OneToManyAnnotation)ownerAt.getResourceAttribute().getAnnotation(OneToManyAnnotation.ANNOTATION_NAME); @@ -198,7 +198,7 @@ public class CreateRelationsTest { assertSame(t1, rel.getOwner()); assertSame(t2, rel.getInverse()); assertEquals("address", rel.getOwnerAttributeName()); - JavaModifiablePersistentAttribute ownerAt = t1.getAttributeNamed("address"); + JavaSpecifiedPersistentAttribute ownerAt = t1.getAttributeNamed("address"); assertNotNull(ownerAt); ManyToOneAnnotation an = (ManyToOneAnnotation)ownerAt.getResourceAttribute().getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME); assertNotNull(an); @@ -211,13 +211,13 @@ public class CreateRelationsTest { assertSame(t1, rel.getOwner()); assertSame(t2, rel.getInverse()); assertEquals("address", rel.getOwnerAttributeName()); - JavaModifiablePersistentAttribute ownerAt = t1.getAttributeNamed("address"); + JavaSpecifiedPersistentAttribute ownerAt = t1.getAttributeNamed("address"); assertNotNull(ownerAt); ManyToOneAnnotation an = (ManyToOneAnnotation)ownerAt.getResourceAttribute().getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME); assertNotNull(an); assertEquals("customer", rel.getInverseAttributeName()); - JavaModifiablePersistentAttribute inverseAt = t2.getAttributeNamed("customer"); + JavaSpecifiedPersistentAttribute inverseAt = t2.getAttributeNamed("customer"); assertNotNull(inverseAt); OneToManyAnnotation an1 = (OneToManyAnnotation)inverseAt.getResourceAttribute().getAnnotation(OneToManyAnnotation.ANNOTATION_NAME); assertNotNull(an1); @@ -231,7 +231,7 @@ public class CreateRelationsTest { assertSame(t1, rel.getOwner()); assertSame(t2, rel.getInverse()); assertEquals("address", rel.getOwnerAttributeName()); - JavaModifiablePersistentAttribute ownerAt = t1.getAttributeNamed("address"); + JavaSpecifiedPersistentAttribute ownerAt = t1.getAttributeNamed("address"); assertNotNull(ownerAt); ManyToManyAnnotation an = (ManyToManyAnnotation)ownerAt.getResourceAttribute().getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME); assertNotNull(an); @@ -245,13 +245,13 @@ public class CreateRelationsTest { assertSame(t1, rel.getOwner()); assertSame(t2, rel.getInverse()); assertEquals("address", rel.getOwnerAttributeName()); - JavaModifiablePersistentAttribute ownerAt = t1.getAttributeNamed("address"); + JavaSpecifiedPersistentAttribute ownerAt = t1.getAttributeNamed("address"); assertNotNull(ownerAt); ManyToManyAnnotation an = (ManyToManyAnnotation)ownerAt.getResourceAttribute().getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME); assertNotNull(an); assertNull(an.getMappedBy()); - JavaModifiablePersistentAttribute inverseAt = t2.getAttributeNamed("customer"); + JavaSpecifiedPersistentAttribute inverseAt = t2.getAttributeNamed("customer"); assertNotNull(inverseAt); an = (ManyToManyAnnotation)inverseAt.getResourceAttribute().getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME); assertNotNull(an); @@ -300,7 +300,7 @@ public class CreateRelationsTest { assertSame(t1, rel.getOwner()); assertSame(t2, rel.getInverse()); assertEquals("address", rel.getOwnerAttributeName()); - JavaModifiablePersistentAttribute ownerAt = t1.getAttributeNamed("address"); + JavaSpecifiedPersistentAttribute ownerAt = t1.getAttributeNamed("address"); assertNotNull(ownerAt); Object o1 = ownerAt.getResourceAttribute().getAnnotation(OneToManyAnnotation.ANNOTATION_NAME); @@ -362,7 +362,7 @@ public class CreateRelationsTest { assertSame(t1, rel.getOwner()); assertSame(t2, rel.getInverse()); assertEquals("project", rel.getOwnerAttributeName()); - JavaModifiablePersistentAttribute ownerAt = t1.getAttributeNamed("project"); + JavaSpecifiedPersistentAttribute ownerAt = t1.getAttributeNamed("project"); assertNotNull(ownerAt); Object o1 = ownerAt.getResourceAttribute().getAnnotation(OneToManyAnnotation.ANNOTATION_NAME); @@ -422,7 +422,7 @@ public class CreateRelationsTest { assertSame(t1, rel.getOwner()); assertSame(t2, rel.getInverse()); assertEquals("person", rel.getOwnerAttributeName()); - JavaModifiablePersistentAttribute ownerAt = t1.getAttributeNamed("person"); + JavaSpecifiedPersistentAttribute ownerAt = t1.getAttributeNamed("person"); assertNotNull(ownerAt); Object o1 = ownerAt.getResourceAttribute().getAnnotation(OneToManyAnnotation.ANNOTATION_NAME); diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/JPAEditorUtilTest.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/JPAEditorUtilTest.java index d1ac8c9fae..eaf8bc4df9 100644 --- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/JPAEditorUtilTest.java +++ b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/util/JPAEditorUtilTest.java @@ -37,7 +37,7 @@ import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType; import org.eclipse.jpt.jpa.core.JpaProject; -import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute; +import org.eclipse.jpt.jpa.core.context.java.JavaSpecifiedPersistentAttribute; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType; import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.IPeServiceUtil; import org.eclipse.jpt.jpadiagrameditor.ui.internal.util.JPAEditorConstants; @@ -276,7 +276,7 @@ public class JPAEditorUtilTest { return; assertNotNull(JPAEditorUtil.getText(t1)); assertNotNull(JPAEditorUtil.getTooltipText(t1)); - JavaModifiablePersistentAttribute jpa = t1.getAttributeNamed("id"); + JavaSpecifiedPersistentAttribute jpa = t1.getAttributeNamed("id"); assertNotNull(jpa); assertNotNull(JPAEditorUtil.getText(jpa)); assertNotNull(JPAEditorUtil.getTooltipText(jpa)); |