diff options
author | kmoore | 2007-05-29 17:00:02 +0000 |
---|---|---|
committer | kmoore | 2007-05-29 17:00:02 +0000 |
commit | 000ca1a532fe644a2e4d5a041e47bbf9dfd98c4e (patch) | |
tree | 226d2483eb5ab775eb25b2ef3da158e1821ac3ab /jpa/plugins/org.eclipse.jpt.core | |
parent | 75a0d6d8e722b0e6d1ca4acc86bdff20d619b7b0 (diff) | |
download | webtools.dali-000ca1a532fe644a2e4d5a041e47bbf9dfd98c4e.tar.gz webtools.dali-000ca1a532fe644a2e4d5a041e47bbf9dfd98c4e.tar.xz webtools.dali-000ca1a532fe644a2e4d5a041e47bbf9dfd98c4e.zip |
188905 - don't cache javaPersistentType, renames in java cause this to be invalid as well as setting the class String in XmlPersistenType
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.core')
-rw-r--r-- | jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPersistentType.java | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPersistentType.java index b7dd1489a6..220621a726 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPersistentType.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/orm/XmlPersistentType.java @@ -150,8 +150,6 @@ public class XmlPersistentType extends XmlEObject implements IPersistentType */ protected EList<XmlPersistentAttribute> virtualPersistentAttributes; - private JavaPersistentType javaPersistentType; - private Collection<IXmlTypeMappingProvider> typeMappingProviders; private IPersistentType parentPersistentType; @@ -275,17 +273,13 @@ public class XmlPersistentType extends XmlEObject implements IPersistentType * @see #getClass_() * @generated */ - public void setClassGen(String newClass) { + public void setClass(String newClass) { String oldClass = class_; class_ = newClass; if (eNotificationRequired()) eNotify(new ENotificationImpl(this, Notification.SET, OrmPackage.XML_PERSISTENT_TYPE__CLASS, oldClass, class_)); } - public void setClass(String newClass) { - setClassGen(newClass); - } - /** * Returns the value of the '<em><b>Attribute Mappings</b></em>' containment reference list. * The list contents are of type {@link org.eclipse.jpt.core.internal.content.orm.XmlAttributeMapping}. @@ -770,21 +764,17 @@ public class XmlPersistentType extends XmlEObject implements IPersistentType } public JavaPersistentType findJavaPersistentType() { - if (this.javaPersistentType == null) { - IType iType = findJdtType(); - if (iType != null) { - for (IJpaFile jpaFile : getJpaProject().jpaFiles(JptCorePlugin.JAVA_CONTENT_TYPE)) { - for (Iterator i = ((JpaCompilationUnit) jpaFile.getContent()).getTypes().iterator(); i.hasNext();) { - JavaPersistentType javaPersistentType = (JavaPersistentType) i.next(); - if (javaPersistentType.jdtType().equals(iType)) { - this.javaPersistentType = javaPersistentType; - break; - } + IType iType = findJdtType(); + if (iType != null) { + for (IJpaFile jpaFile : getJpaProject().jpaFiles(JptCorePlugin.JAVA_CONTENT_TYPE)) { + for (JavaPersistentType javaPersistentType : ((JpaCompilationUnit) jpaFile.getContent()).getTypes()) { + if (javaPersistentType.jdtType().equals(iType)) { + return javaPersistentType; } } } } - return this.javaPersistentType; + return null; } public Type findType() { |