Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Vosburgh2013-02-26 22:40:25 +0000
committerBrian Vosburgh2013-03-05 19:52:12 +0000
commit78a37788424c7cf7a13633a0293d4bb26e0397db (patch)
tree17d533d58c59d35871851cef1ca822371a33a2bf /jpa_diagram_editor
parenta1995ca23d67ec68dcae3ad71b27a6f34f48d2fc (diff)
downloadwebtools.dali-78a37788424c7cf7a13633a0293d4bb26e0397db.tar.gz
webtools.dali-78a37788424c7cf7a13633a0293d4bb26e0397db.tar.xz
webtools.dali-78a37788424c7cf7a13633a0293d4bb26e0397db.zip
rename ReadOnlyPersistentAttribute to PersistentAttribute
Diffstat (limited to 'jpa_diagram_editor')
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/feature/EmbedCollectionOfObjectsFeature.java4
-rw-r--r--jpa_diagram_editor/plugins/org.eclipse.jpt.jpadiagrameditor.ui/src/org/eclipse/jpt/jpadiagrameditor/ui/internal/util/JpaArtifactFactory.java14
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/JPACreateFactory.java14
-rw-r--r--jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/relation/CreateRelationAttributesTest.java22
4 files changed, 27 insertions, 27 deletions
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 8c7241f4b3..0256ee295e 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
@@ -30,7 +30,7 @@ import org.eclipse.jpt.jpa.core.context.Embeddable;
import org.eclipse.jpt.jpa.core.context.Entity;
import org.eclipse.jpt.jpa.core.context.MappedSuperclass;
import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaModifiablePersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
@@ -166,7 +166,7 @@ public class EmbedCollectionOfObjectsFeature extends AbstractCreateConnectionFea
private boolean isNotAllowed(JavaPersistentType embeddingEntity, JavaPersistentType embeddable){
boolean notAllowed = false;
if(JpaArtifactFactory.instance().hasEmbeddableAnnotation(embeddable)){
- for(ReadOnlyPersistentAttribute attr : embeddable.getAllAttributes()){
+ for(PersistentAttribute attr : embeddable.getAllAttributes()){
if(attr.getMappingKey().equals(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY)){
return true;
}
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 623a224064..9dc362df1f 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
@@ -69,7 +69,7 @@ import org.eclipse.jpt.jpa.core.MappingKeys;
import org.eclipse.jpt.jpa.core.context.AttributeMapping;
import org.eclipse.jpt.jpa.core.context.Embeddable;
import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
+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;
@@ -1810,10 +1810,10 @@ public class JpaArtifactFactory {
// returns true even if the primary key is inherited
public boolean hasOrInheritsPrimaryKey(JavaPersistentType jpt) {
- Iterable<ReadOnlyPersistentAttribute> attributes = jpt.getAllAttributes();
- Iterator<ReadOnlyPersistentAttribute> it = attributes.iterator();
+ Iterable<PersistentAttribute> attributes = jpt.getAllAttributes();
+ Iterator<PersistentAttribute> it = attributes.iterator();
while (it.hasNext()) {
- ReadOnlyPersistentAttribute at = it.next();
+ PersistentAttribute at = it.next();
if (isId(at))
return true;
}
@@ -1844,11 +1844,11 @@ public class JpaArtifactFactory {
return null;
}
- public boolean isId(ReadOnlyPersistentAttribute jpa) {
+ public boolean isId(PersistentAttribute jpa) {
return isSimpleId(jpa) || isEmbeddedId(jpa);
}
- public boolean isSimpleId(ReadOnlyPersistentAttribute jpa) {
+ public boolean isSimpleId(PersistentAttribute jpa) {
return (jpa.getMappingKey() == MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
}
@@ -1870,7 +1870,7 @@ public class JpaArtifactFactory {
return null;
}
- public boolean isEmbeddedId(ReadOnlyPersistentAttribute jpa) {
+ public boolean isEmbeddedId(PersistentAttribute jpa) {
return (jpa.getMappingKey() == MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
}
diff --git a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/JPACreateFactory.java b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/JPACreateFactory.java
index 627f5b0669..52884b411c 100644
--- a/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/JPACreateFactory.java
+++ b/jpa_diagram_editor/tests/org.eclipse.jpt.jpadiagrameditor.ui.tests/src/org/eclipse/jpt/jpadiagrameditor/ui/tests/internal/JPACreateFactory.java
@@ -49,7 +49,7 @@ import org.eclipse.jpt.jpa.core.JpaProject;
import org.eclipse.jpt.jpa.core.JpaStructureNode;
import org.eclipse.jpt.jpa.core.context.JpaContextModelRoot;
import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXml;
import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetDataModelProperties;
@@ -532,9 +532,9 @@ public class JPACreateFactory {
}
}
- public static ReadOnlyPersistentAttribute getPersistentAttribute(IFile entity, String attributeName){
- Set<ReadOnlyPersistentAttribute> result = getEntityFields(entity);
- for(ReadOnlyPersistentAttribute attribute : result){
+ public static PersistentAttribute getPersistentAttribute(IFile entity, String attributeName){
+ Set<PersistentAttribute> result = getEntityFields(entity);
+ for(PersistentAttribute attribute : result){
if(attributeName.equals(attribute.getName())){
return attribute;
}
@@ -558,15 +558,15 @@ public class JPACreateFactory {
return jpaFile.getRootStructureNodes();
}
- public static Set<ReadOnlyPersistentAttribute> getEntityFields(IFile file){
- Set<ReadOnlyPersistentAttribute> result = new HashSet<ReadOnlyPersistentAttribute>();
+ public static Set<PersistentAttribute> getEntityFields(IFile file){
+ Set<PersistentAttribute> result = new HashSet<PersistentAttribute>();
JpaFile jpaFile = getJpaFile(file);
if(jpaFile == null){
return result;
}
for (JpaStructureNode node : getRootNodes(jpaFile)) {
PersistentType entity = (PersistentType) node;
- for (ReadOnlyPersistentAttribute attribute : entity.getAllAttributes()) {
+ for (PersistentAttribute attribute : entity.getAllAttributes()) {
result.add(attribute);
}
}
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 6460d8d689..921c04f13e 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
@@ -28,7 +28,7 @@ import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
import org.eclipse.jpt.jpa.core.JpaProject;
import org.eclipse.jpt.jpa.core.context.AttributeMapping;
import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
+import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
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;
@@ -162,7 +162,7 @@ public class CreateRelationAttributesTest {
pt = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, addressType.getTypeBinding().getQualifiedName());
}
- ReadOnlyPersistentAttribute cPersistentAttribute = pt.resolveAttribute("address");
+ PersistentAttribute cPersistentAttribute = pt.resolveAttribute("address");
assertNotNull(cPersistentAttribute);
}
@@ -217,7 +217,7 @@ public class CreateRelationAttributesTest {
ownerPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName());
}
- ReadOnlyPersistentAttribute ownerPersistentAttribute = ownerPersistentType.resolveAttribute("creditCard");
+ PersistentAttribute ownerPersistentAttribute = ownerPersistentType.resolveAttribute("creditCard");
assertNotNull(ownerPersistentAttribute);
assertTrue(ownerPersistentAttribute instanceof JavaModifiablePersistentAttribute);
@@ -232,7 +232,7 @@ public class CreateRelationAttributesTest {
inversePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, creditCardType.getTypeBinding().getQualifiedName());
}
- ReadOnlyPersistentAttribute inversePersistentAttribute = inversePersistentType.resolveAttribute("customer");
+ PersistentAttribute inversePersistentAttribute = inversePersistentType.resolveAttribute("customer");
assertNotNull(inversePersistentAttribute);
assertTrue(inversePersistentAttribute instanceof JavaModifiablePersistentAttribute);
@@ -286,7 +286,7 @@ public class CreateRelationAttributesTest {
pt = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, phoneType.getTypeBinding().getQualifiedName());
}
- ReadOnlyPersistentAttribute cPersistentAttribute = pt.resolveAttribute("phones");
+ PersistentAttribute cPersistentAttribute = pt.resolveAttribute("phones");
assertNotNull(cPersistentAttribute);
AttributeMapping mapping = cPersistentAttribute.getMapping();
@@ -346,7 +346,7 @@ public class CreateRelationAttributesTest {
inversePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, cruiseType.getTypeBinding().getQualifiedName());
}
- ReadOnlyPersistentAttribute inversePersistentAttribute = inversePersistentType.resolveAttribute("reservations");
+ PersistentAttribute inversePersistentAttribute = inversePersistentType.resolveAttribute("reservations");
assertNotNull(inversePersistentAttribute);
assertTrue(inversePersistentAttribute instanceof JavaModifiablePersistentAttribute);
@@ -365,7 +365,7 @@ public class CreateRelationAttributesTest {
}
assertNotNull(ownerPersistentType);
- ReadOnlyPersistentAttribute ownerPersistentAttribute = ownerPersistentType.resolveAttribute("cruise");
+ PersistentAttribute ownerPersistentAttribute = ownerPersistentType.resolveAttribute("cruise");
c = 0;
while ((ownerPersistentAttribute == null) && (c < 50)) {
Thread.sleep(200);
@@ -433,7 +433,7 @@ public class CreateRelationAttributesTest {
pt = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, shipType.getTypeBinding().getQualifiedName());
}
- ReadOnlyPersistentAttribute cPersistentAttribute = pt.resolveAttribute("ship");
+ PersistentAttribute cPersistentAttribute = pt.resolveAttribute("ship");
int cnt = 0;
while ((cPersistentAttribute == null) && (cnt < 100)) {
Thread.sleep(250);
@@ -502,7 +502,7 @@ public class CreateRelationAttributesTest {
ownerPersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getTypeBinding().getQualifiedName());
}
- ReadOnlyPersistentAttribute ownerPersistentAttribute = ownerPersistentType.resolveAttribute("customers");
+ PersistentAttribute ownerPersistentAttribute = ownerPersistentType.resolveAttribute("customers");
assertNotNull(ownerPersistentAttribute);
assertTrue(ownerPersistentAttribute instanceof JavaModifiablePersistentAttribute);
@@ -517,7 +517,7 @@ public class CreateRelationAttributesTest {
inversePersistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, customerType.getTypeBinding().getQualifiedName());
}
- ReadOnlyPersistentAttribute inversePersistentAttribute = inversePersistentType.resolveAttribute("reservations");
+ PersistentAttribute inversePersistentAttribute = inversePersistentType.resolveAttribute("reservations");
assertNotNull(inversePersistentAttribute);
assertTrue(inversePersistentAttribute instanceof JavaModifiablePersistentAttribute);
@@ -569,7 +569,7 @@ public class CreateRelationAttributesTest {
persistentType = JpaArtifactFactory.instance().getContextPersistentType(jpaProject, reservationType.getTypeBinding().getQualifiedName());
}
- ReadOnlyPersistentAttribute persistentAttribute = persistentType.resolveAttribute("cabins");
+ PersistentAttribute persistentAttribute = persistentType.resolveAttribute("cabins");
assertNotNull(persistentAttribute);
assertTrue(persistentAttribute instanceof JavaModifiablePersistentAttribute);

Back to the top