Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmoore2012-04-05 14:18:03 -0400
committerkmoore2012-04-05 14:18:03 -0400
commit91539e48623ada3fcb324e3d8a1eaa660f67d703 (patch)
treec6e7ad35401cb8845918f0f5b65d004992abdf6b
parentf6ccde493d28e9779a147f72e3f7b9db46b7dbc6 (diff)
downloadwebtools.dali-91539e48623ada3fcb324e3d8a1eaa660f67d703.tar.gz
webtools.dali-91539e48623ada3fcb324e3d8a1eaa660f67d703.tar.xz
webtools.dali-91539e48623ada3fcb324e3d8a1eaa660f67d703.zip
build some things during construction and reordered to minimize the number of updates
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaEntity.java10
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmEntity.java10
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/AbstractOrmPersistenceUnitDefaults.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/persistence/GenericClassRef.java6
4 files changed, 19 insertions, 11 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaEntity.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaEntity.java
index a995db8db3..a556674c0a 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaEntity.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaEntity.java
@@ -217,6 +217,8 @@ public abstract class AbstractJavaEntity
this.idClassReference.update();
+ this.setDefaultInheritanceStrategy(this.buildDefaultInheritanceStrategy());
+
this.table.update();
this.setSpecifiedTableIsAllowed(this.buildSpecifiedTableIsAllowed());
this.setTableIsUndefined(this.buildTableIsUndefined());
@@ -226,16 +228,14 @@ public abstract class AbstractJavaEntity
this.updateDefaultPrimaryKeyJoinColumn();
this.updateNodes(this.getPrimaryKeyJoinColumns());
- this.setDefaultInheritanceStrategy(this.buildDefaultInheritanceStrategy());
+ this.discriminatorColumn.update();
+ this.setSpecifiedDiscriminatorColumnIsAllowed(this.buildSpecifiedDiscriminatorColumnIsAllowed());
+ this.setDiscriminatorColumnIsUndefined(this.buildDiscriminatorColumnIsUndefined());
this.setDefaultDiscriminatorValue(this.buildDefaultDiscriminatorValue());
this.setSpecifiedDiscriminatorValueIsAllowed(this.buildSpecifiedDiscriminatorValueIsAllowed());
this.setDiscriminatorValueIsUndefined(this.buildDiscriminatorValueIsUndefined());
- this.discriminatorColumn.update();
- this.setSpecifiedDiscriminatorColumnIsAllowed(this.buildSpecifiedDiscriminatorColumnIsAllowed());
- this.setDiscriminatorColumnIsUndefined(this.buildDiscriminatorColumnIsUndefined());
-
this.attributeOverrideContainer.update();
this.associationOverrideContainer.update();
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmEntity.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmEntity.java
index e2d748bc0b..78ae7e70c7 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmEntity.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmEntity.java
@@ -251,6 +251,8 @@ public abstract class AbstractOrmEntity<X extends XmlEntity>
this.idClassReference.update();
+ this.setDefaultInheritanceStrategy(this.buildDefaultInheritanceStrategy());
+
this.table.update();
this.setSpecifiedTableIsAllowed(this.buildSpecifiedTableIsAllowed());
this.setTableIsUndefined(this.buildTableIsUndefined());
@@ -261,16 +263,14 @@ public abstract class AbstractOrmEntity<X extends XmlEntity>
this.updateDefaultPrimaryKeyJoinColumns();
this.updateNodes(this.getPrimaryKeyJoinColumns());
- this.setDefaultInheritanceStrategy(this.buildDefaultInheritanceStrategy());
+ this.discriminatorColumn.update();
+ this.setSpecifiedDiscriminatorColumnIsAllowed(this.buildSpecifiedDiscriminatorColumnIsAllowed());
+ this.setDiscriminatorColumnIsUndefined(this.buildDiscriminatorColumnIsUndefined());
this.setDefaultDiscriminatorValue(this.buildDefaultDiscriminatorValue());
this.setSpecifiedDiscriminatorValueIsAllowed(this.buildSpecifiedDiscriminatorValueIsAllowed());
this.setDiscriminatorValueIsUndefined(this.buildDiscriminatorValueIsUndefined());
- this.discriminatorColumn.update();
- this.setSpecifiedDiscriminatorColumnIsAllowed(this.buildSpecifiedDiscriminatorColumnIsAllowed());
- this.setDiscriminatorColumnIsUndefined(this.buildDiscriminatorColumnIsUndefined());
-
this.attributeOverrideContainer.update();
this.associationOverrideContainer.update();
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/AbstractOrmPersistenceUnitDefaults.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/AbstractOrmPersistenceUnitDefaults.java
index 0e7ab51c70..6798f57c11 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/AbstractOrmPersistenceUnitDefaults.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/AbstractOrmPersistenceUnitDefaults.java
@@ -53,6 +53,10 @@ public abstract class AbstractOrmPersistenceUnitDefaults
this.specifiedSchema = this.buildSpecifiedSchema();
this.cascadePersist = this.buildCascadePersist();
this.delimitedIdentifiers = this.buildDelimitedIdentifiers();
+
+ //already available from JpaProject, so set it here, many things depend on these
+ this.defaultCatalog = this.buildDefaultCatalog();
+ this.defaultSchema = this.buildDefaultSchema();
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/persistence/GenericClassRef.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/persistence/GenericClassRef.java
index 5ad77e09a5..2114da89c9 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/persistence/GenericClassRef.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/persistence/GenericClassRef.java
@@ -81,7 +81,11 @@ public class GenericClassRef
super(parent);
this.xmlJavaClassRef = xmlJavaClassRef;
this.className = className;
- // 'javaPersistentType' is resolved in the update
+ // build 'javaPersistentType' here, but also resolve in the update
+ JavaResourceType resourceType = this.resolveJavaResourceType();
+ if (resourceType != null) {
+ this.javaPersistentType = this.buildJavaPersistentType(resourceType);
+ }
}

Back to the top