Skip to main content
summaryrefslogtreecommitdiffstats
path: root/jpa
diff options
context:
space:
mode:
authorkmoore2008-09-10 18:59:16 +0000
committerkmoore2008-09-10 18:59:16 +0000
commit7316bc1266423bc111cf8ea840d3b92df72ad1fa (patch)
tree032b232fd37ab59197f453cdc10b7389dc242ada /jpa
parentd71ae87317aa86797e6356314a86fda43beff4e1 (diff)
downloadwebtools.dali-7316bc1266423bc111cf8ea840d3b92df72ad1fa.tar.gz
webtools.dali-7316bc1266423bc111cf8ea840d3b92df72ad1fa.tar.xz
webtools.dali-7316bc1266423bc111cf8ea840d3b92df72ad1fa.zip
added helper method getAttributeTextRange(String) to reduce code duplication
Diffstat (limited to 'jpa')
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/AbstractJpaEObject.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlAbstractColumn.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlAttributeMapping.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlBaseTable.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlNamedColumn.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlTypeMapping.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGeneratedValueImpl.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinColumnImpl.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToManyImpl.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedNativeQuery.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedQuery.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToManyImpl.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToOneImpl.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPrimaryKeyJoinColumnImpl.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSequenceGeneratorImpl.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTableGeneratorImpl.java5
16 files changed, 24 insertions, 72 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/AbstractJpaEObject.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/AbstractJpaEObject.java
index 0336a88400..fa4ed2f08f 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/AbstractJpaEObject.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/common/AbstractJpaEObject.java
@@ -20,6 +20,7 @@ import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.jpt.core.internal.utility.emf.DOMUtilities;
import org.eclipse.jpt.core.utility.AbstractTextRange;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.utility.internal.ClassTools;
@@ -198,6 +199,11 @@ public abstract class AbstractJpaEObject extends EObjectImpl implements JpaEObje
}
}
+ protected TextRange getAttributeTextRange(String attributeName) {
+ IDOMNode node = (IDOMNode) DOMUtilities.childAttributeNode(this.node, attributeName);
+ return (node == null) ? getValidationTextRange() : buildTextRange(node);
+ }
+
public TextRange getValidationTextRange() {
return getFullTextRange();
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlAbstractColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlAbstractColumn.java
index 334faf53a7..a49888ac34 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlAbstractColumn.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlAbstractColumn.java
@@ -16,9 +16,7 @@ import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.jpt.core.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.internal.utility.emf.DOMUtilities;
import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
/**
* <!-- begin-user-doc -->
@@ -512,7 +510,6 @@ public abstract class AbstractXmlAbstractColumn extends AbstractXmlNamedColumn i
}
public TextRange getTableTextRange() {
- IDOMNode tableNode = (IDOMNode) DOMUtilities.childAttributeNode(this.node, OrmXmlMapper.TABLE);
- return (tableNode == null) ? getValidationTextRange() : buildTextRange(tableNode);
+ return getAttributeTextRange(OrmXmlMapper.TABLE);
}
} // AbstractXmlAbstractColumn
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlAttributeMapping.java
index 61efb9f072..6795010bbe 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlAttributeMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlAttributeMapping.java
@@ -13,10 +13,8 @@ import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.jpt.core.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.internal.utility.emf.DOMUtilities;
import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
/**
* <!-- begin-user-doc -->
@@ -196,8 +194,7 @@ public abstract class AbstractXmlAttributeMapping extends AbstractJpaEObject imp
}
public TextRange getNameTextRange() {
- IDOMNode nameNode = (IDOMNode) DOMUtilities.childAttributeNode(this.node, OrmXmlMapper.NAME);
- return (nameNode != null) ? this.buildTextRange(nameNode) : this.getValidationTextRange();
+ return getAttributeTextRange(OrmXmlMapper.NAME);
}
} // AbstractXmlAttributeMapping
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlBaseTable.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlBaseTable.java
index c778d23fd9..8a04c7baa8 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlBaseTable.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlBaseTable.java
@@ -25,10 +25,8 @@ import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.jpt.core.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.internal.utility.emf.DOMUtilities;
import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
/**
* <!-- begin-user-doc -->
@@ -404,18 +402,15 @@ public abstract class AbstractXmlBaseTable extends AbstractJpaEObject implements
public TextRange getNameTextRange() {
- IDOMNode nameNode = (IDOMNode) DOMUtilities.childAttributeNode(this.node, OrmXmlMapper.NAME);
- return (nameNode == null) ? getValidationTextRange() : buildTextRange(nameNode);
+ return getAttributeTextRange(OrmXmlMapper.NAME);
}
public TextRange getCatalogTextRange() {
- IDOMNode catalogNode = (IDOMNode) DOMUtilities.childAttributeNode(this.node, OrmXmlMapper.CATALOG);
- return (catalogNode == null) ? getValidationTextRange() : buildTextRange(catalogNode);
+ return getAttributeTextRange(OrmXmlMapper.CATALOG);
}
public TextRange getSchemaTextRange() {
- IDOMNode schemaNode = (IDOMNode) DOMUtilities.childAttributeNode(this.node, OrmXmlMapper.SCHEMA);
- return (schemaNode == null) ? getValidationTextRange() : buildTextRange(schemaNode);
+ return getAttributeTextRange(OrmXmlMapper.SCHEMA);
}
} // AbstractXmlBaseTable
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlNamedColumn.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlNamedColumn.java
index 041e8c2b34..3e3e826d82 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlNamedColumn.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlNamedColumn.java
@@ -16,10 +16,8 @@ import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.jpt.core.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.internal.utility.emf.DOMUtilities;
import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
/**
* <!-- begin-user-doc -->
@@ -266,8 +264,7 @@ public abstract class AbstractXmlNamedColumn extends AbstractJpaEObject implemen
}
public TextRange getNameTextRange() {
- IDOMNode nameNode = (IDOMNode) DOMUtilities.childAttributeNode(this.node, OrmXmlMapper.NAME);
- return (nameNode == null) ? getValidationTextRange() : buildTextRange(nameNode);
+ return getAttributeTextRange(OrmXmlMapper.NAME);
}
} // AbstractXmlNamedColumn
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlTypeMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlTypeMapping.java
index ac633e92d2..42f0ded60f 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlTypeMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/AbstractXmlTypeMapping.java
@@ -15,11 +15,9 @@ import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.jpt.core.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.internal.utility.emf.DOMUtilities;
import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
import org.eclipse.jpt.core.resource.common.JpaEObject;
import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
/**
* <!-- begin-user-doc -->
@@ -508,19 +506,11 @@ public abstract class AbstractXmlTypeMapping extends AbstractJpaEObject implemen
public TextRange getClassTextRange() {
- IDOMNode classNode = (IDOMNode) DOMUtilities.childAttributeNode(node, OrmXmlMapper.CLASS);
- if (classNode != null) {
- return buildTextRange(classNode);
- }
- return getValidationTextRange();
+ return getAttributeTextRange(OrmXmlMapper.CLASS);
}
public TextRange getAttributesTextRange() {
- IDOMNode attributesNode = (IDOMNode) DOMUtilities.getNodeChild(node, OrmXmlMapper.ATTRIBUTES);
- if (attributesNode != null) {
- return buildTextRange(attributesNode);
- }
- return getValidationTextRange();
+ return getAttributeTextRange(OrmXmlMapper.ATTRIBUTES);
}
} // TypeMapping
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGeneratedValueImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGeneratedValueImpl.java
index 227227f84b..4d30fa1669 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGeneratedValueImpl.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlGeneratedValueImpl.java
@@ -13,10 +13,8 @@ import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.jpt.core.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.internal.utility.emf.DOMUtilities;
import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
/**
* <!-- begin-user-doc -->
@@ -263,7 +261,6 @@ public class XmlGeneratedValueImpl extends AbstractJpaEObject implements XmlGene
}
public TextRange getGeneratorTextRange() {
- IDOMNode generatorNode = (IDOMNode) DOMUtilities.childAttributeNode(this.node, OrmXmlMapper.GENERATOR);
- return (generatorNode == null) ? getValidationTextRange() : buildTextRange(generatorNode);
+ return getAttributeTextRange(OrmXmlMapper.GENERATOR);
}
} // GeneratedValue
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinColumnImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinColumnImpl.java
index 61e65f7801..bf46b1b4a1 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinColumnImpl.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlJoinColumnImpl.java
@@ -13,9 +13,7 @@ import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.jpt.core.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.internal.utility.emf.DOMUtilities;
import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
/**
* <!-- begin-user-doc -->
@@ -233,7 +231,6 @@ public class XmlJoinColumnImpl extends AbstractXmlAbstractColumn implements XmlJ
}
public TextRange getReferencedColumnNameTextRange() {
- IDOMNode referencedColumnNameNode = (IDOMNode) DOMUtilities.childAttributeNode(this.node, OrmXmlMapper.REFERENCED_COLUMN_NAME);
- return (referencedColumnNameNode == null) ? getValidationTextRange() : buildTextRange(referencedColumnNameNode);
+ return getAttributeTextRange(OrmXmlMapper.REFERENCED_COLUMN_NAME);
}
} // JoinColumn
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToManyImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToManyImpl.java
index 82c025aaad..ee745eb3e7 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToManyImpl.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlManyToManyImpl.java
@@ -15,9 +15,7 @@ import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.jpt.core.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.internal.utility.emf.DOMUtilities;
import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
/**
* <!-- begin-user-doc -->
@@ -736,7 +734,6 @@ public class XmlManyToManyImpl extends AbstractXmlAttributeMapping implements Xm
}
public TextRange getMappedByTextRange() {
- IDOMNode mappedByNode = (IDOMNode) DOMUtilities.childAttributeNode(getNode(), OrmXmlMapper.MAPPED_BY);
- return (mappedByNode == null) ? getValidationTextRange() : buildTextRange(mappedByNode);
+ return getAttributeTextRange(OrmXmlMapper.MAPPED_BY);
}
} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedNativeQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedNativeQuery.java
index 13df8211fe..3bc2fcfa89 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedNativeQuery.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedNativeQuery.java
@@ -19,10 +19,8 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.jpt.core.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.internal.utility.emf.DOMUtilities;
import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
/**
* <!-- begin-user-doc -->
@@ -471,7 +469,6 @@ public class XmlNamedNativeQuery extends AbstractJpaEObject implements XmlQuery
}
public TextRange getNameTextRange() {
- IDOMNode nameNode = (IDOMNode) DOMUtilities.childAttributeNode(getNode(), OrmXmlMapper.NAME);
- return (nameNode == null) ? getValidationTextRange() : buildTextRange(nameNode);
+ return getAttributeTextRange(OrmXmlMapper.NAME);
}
} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedQuery.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedQuery.java
index 742966a42f..8388735029 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedQuery.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlNamedQuery.java
@@ -19,10 +19,8 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.jpt.core.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.internal.utility.emf.DOMUtilities;
import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
/**
* <!-- begin-user-doc -->
@@ -330,7 +328,6 @@ public class XmlNamedQuery extends AbstractJpaEObject implements XmlQuery
}
public TextRange getNameTextRange() {
- IDOMNode nameNode = (IDOMNode) DOMUtilities.childAttributeNode(getNode(), OrmXmlMapper.NAME);
- return (nameNode == null) ? getValidationTextRange() : buildTextRange(nameNode);
+ return getAttributeTextRange(OrmXmlMapper.NAME);
}
} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToManyImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToManyImpl.java
index a7c2d5639d..6b988a53e1 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToManyImpl.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToManyImpl.java
@@ -19,9 +19,7 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.jpt.core.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.internal.utility.emf.DOMUtilities;
import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
/**
* <!-- begin-user-doc -->
@@ -789,7 +787,6 @@ public class XmlOneToManyImpl extends AbstractXmlAttributeMapping implements Xml
}
public TextRange getMappedByTextRange() {
- IDOMNode mappedByNode = (IDOMNode) DOMUtilities.childAttributeNode(getNode(), OrmXmlMapper.MAPPED_BY);
- return (mappedByNode == null) ? getValidationTextRange() : buildTextRange(mappedByNode);
+ return getAttributeTextRange(OrmXmlMapper.MAPPED_BY);
}
} // OneToMany
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToOneImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToOneImpl.java
index 6bc035f0f3..4287a0e054 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToOneImpl.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOneToOneImpl.java
@@ -19,9 +19,7 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.jpt.core.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.internal.utility.emf.DOMUtilities;
import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
/**
* <!-- begin-user-doc -->
@@ -753,7 +751,6 @@ public class XmlOneToOneImpl extends AbstractXmlAttributeMapping implements XmlO
}
public TextRange getMappedByTextRange() {
- IDOMNode mappedByNode = (IDOMNode) DOMUtilities.childAttributeNode(getNode(), OrmXmlMapper.MAPPED_BY);
- return (mappedByNode == null) ? getValidationTextRange() : buildTextRange(mappedByNode);
+ return getAttributeTextRange(OrmXmlMapper.MAPPED_BY);
}
} // OneToOne
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPrimaryKeyJoinColumnImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPrimaryKeyJoinColumnImpl.java
index 552b57aec1..1a0ef19f2e 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPrimaryKeyJoinColumnImpl.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlPrimaryKeyJoinColumnImpl.java
@@ -13,9 +13,7 @@ import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.jpt.core.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.internal.utility.emf.DOMUtilities;
import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
/**
* <!-- begin-user-doc -->
@@ -233,7 +231,6 @@ public class XmlPrimaryKeyJoinColumnImpl extends AbstractXmlNamedColumn implemen
}
public TextRange getReferencedColumnNameTextRange() {
- IDOMNode referencedColumnNameNode = (IDOMNode) DOMUtilities.childAttributeNode(this.node, OrmXmlMapper.REFERENCED_COLUMN_NAME);
- return (referencedColumnNameNode == null) ? getValidationTextRange() : buildTextRange(referencedColumnNameNode);
+ return getAttributeTextRange(OrmXmlMapper.REFERENCED_COLUMN_NAME);
}
} // XmlPrimaryKeyJoinColumnImpl
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSequenceGeneratorImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSequenceGeneratorImpl.java
index 121fb05983..09b30bde86 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSequenceGeneratorImpl.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlSequenceGeneratorImpl.java
@@ -13,10 +13,8 @@ import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.jpt.core.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.internal.utility.emf.DOMUtilities;
import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
/**
* <!-- begin-user-doc -->
@@ -397,8 +395,7 @@ public class XmlSequenceGeneratorImpl extends AbstractJpaEObject implements XmlS
}
public TextRange getNameTextRange() {
- IDOMNode nameNode = (IDOMNode) DOMUtilities.childAttributeNode(getNode(), OrmXmlMapper.NAME);
- return (nameNode == null) ? getValidationTextRange() : buildTextRange(nameNode);
+ return getAttributeTextRange(OrmXmlMapper.NAME);
}
public boolean isVirtual() {
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTableGeneratorImpl.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTableGeneratorImpl.java
index fdb15f4837..80c4bf0d62 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTableGeneratorImpl.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlTableGeneratorImpl.java
@@ -19,10 +19,8 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.jpt.core.internal.resource.orm.translators.OrmXmlMapper;
-import org.eclipse.jpt.core.internal.utility.emf.DOMUtilities;
import org.eclipse.jpt.core.resource.common.AbstractJpaEObject;
import org.eclipse.jpt.core.utility.TextRange;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
/**
* <!-- begin-user-doc -->
@@ -799,8 +797,7 @@ public class XmlTableGeneratorImpl extends AbstractJpaEObject implements XmlTabl
}
public TextRange getNameTextRange() {
- IDOMNode nameNode = (IDOMNode) DOMUtilities.childAttributeNode(getNode(), OrmXmlMapper.NAME);
- return (nameNode == null) ? getValidationTextRange() : buildTextRange(nameNode);
+ return getAttributeTextRange(OrmXmlMapper.NAME);
}
public boolean isVirtual() {

Back to the top