diff options
author | kmoore | 2007-08-21 17:39:43 +0000 |
---|---|---|
committer | kmoore | 2007-08-21 17:39:43 +0000 |
commit | e0650844996ab43f1d8f47d2fd47d82e9090520a (patch) | |
tree | 8cd042c5bd5a284fe67afcc02ebedb42830d10e2 /jpa/plugins/org.eclipse.jpt.core | |
parent | bbe27640fdb0718b6db6016ce12db55e92fe1132 (diff) | |
download | webtools.dali-e0650844996ab43f1d8f47d2fd47d82e9090520a.tar.gz webtools.dali-e0650844996ab43f1d8f47d2fd47d82e9090520a.tar.xz webtools.dali-e0650844996ab43f1d8f47d2fd47d82e9090520a.zip |
200712 - annotations on properties are not read the first time updating from java
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/java/JavaPersistentType.java | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentType.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentType.java index 7d8620d64c..9caa1a0584 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentType.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/content/java/JavaPersistentType.java @@ -681,31 +681,27 @@ public class JavaPersistentType extends JavaEObject implements IPersistentType } private void updatePersistentFields(CompilationUnit astRoot, List<JavaPersistentAttribute> persistentAttributesToRemove) { - for (IField field : this.jdtPersistableFields()) { - JavaPersistentAttribute persistentAttribute = persistentAttributeFor(field); - if (persistentAttribute == null) { - persistentAttribute = addJavaPersistentAttribute(field); - } - else { - persistentAttributesToRemove.remove(persistentAttribute); - } - persistentAttribute.updateFromJava(astRoot); - } + updatePersistentAttributes(astRoot, persistentAttributesToRemove, this.jdtPersistableFields()); } private void updatePersistentProperties(CompilationUnit astRoot, List<JavaPersistentAttribute> persistentAttributesToRemove) { - for (IMethod method : this.jdtPersistableProperties()) { - JavaPersistentAttribute persistentAttribute = persistentAttributeFor(method); + updatePersistentAttributes(astRoot, persistentAttributesToRemove, this.jdtPersistableProperties()); + } + + private void updatePersistentAttributes(CompilationUnit astRoot, List<JavaPersistentAttribute> persistentAttributesToRemove, IMember[] members) { + for (IMember member : members) { + JavaPersistentAttribute persistentAttribute = persistentAttributeFor(member); if (persistentAttribute == null) { - addJavaPersistentAttribute(method); + persistentAttribute = addJavaPersistentAttribute(member); } else { persistentAttributesToRemove.remove(persistentAttribute); - persistentAttribute.updateFromJava(astRoot); } + persistentAttribute.updateFromJava(astRoot); } } + private IField[] jdtPersistableFields() { return AttributeAnnotationTools.persistableFields(jdtType()); } |