Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Vosburgh2016-09-01 21:59:16 +0000
committerBrian Vosburgh2017-05-18 22:39:09 +0000
commit1de7a4bedd238bfbd3005c2463f52b1358e12d3b (patch)
tree7b80ce69e0405f0ccfc5ef220814512b4f1bed86
parent6e68876f888106d9f215935e282e27df785b1bf5 (diff)
downloadwebtools.dali-1de7a4bedd238bfbd3005c2463f52b1358e12d3b.tar.gz
webtools.dali-1de7a4bedd238bfbd3005c2463f52b1358e12d3b.tar.xz
webtools.dali-1de7a4bedd238bfbd3005c2463f52b1358e12d3b.zip
rework aspect adapters that allow a null subject when building the
aspect value
-rw-r--r--common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/AspectPropertyValueModelAdapter.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/AccessReference.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/MappingFile.java10
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/MappingFilePersistenceUnitDefaults.java10
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/orm/EntityMappings.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/orm/OrmPersistenceUnitDefaults.java4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaPersistentAttribute.java19
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaPersistentType.java17
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractEntityMappings.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmPersistentAttribute.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/SpecifiedOrmPersistentType.java17
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/AbstractOrmPersistenceUnitDefaults.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmAttributeTypeClassChooser.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnJoiningStrategyPane.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinTableJoiningStrategyPane.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ManyToManyJoiningStrategyPane.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/MappedByJoiningStrategyPane.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnJoiningStrategyPane.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/DerivedIdentityPane2_0.java24
19 files changed, 239 insertions, 211 deletions
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/AspectPropertyValueModelAdapter.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/AspectPropertyValueModelAdapter.java
index f904a8a32a..d08929408a 100644
--- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/AspectPropertyValueModelAdapter.java
+++ b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/model/value/AspectPropertyValueModelAdapter.java
@@ -156,7 +156,7 @@ public abstract class AspectPropertyValueModelAdapter<S, V>
* Return the aspect's value.
* At this point the subject may be <code>null</code>.
*/
- protected V buildValue() {
+ protected final V buildValue() {
return (this.subject == null) ? null : this.buildValue_();
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/AccessReference.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/AccessReference.java
index 999df3a875..fef60ee9d2 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/AccessReference.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/AccessReference.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -31,4 +31,9 @@ public interface AccessReference
* will be set.
*/
AccessType getAccess();
+
+ /**
+ * String constant associated with changes to the access type
+ */
+ String ACCESS_PROPERTY = "access"; //$NON-NLS-1$
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/MappingFile.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/MappingFile.java
index d8a967ab05..e3fe80986b 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/MappingFile.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/MappingFile.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2015 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -93,7 +93,7 @@ public interface MappingFile
* Common interface for the root of a mapping file.
*/
interface Root
- extends JpaStructureNode, PersistentTypeContainer
+ extends JpaStructureNode, PersistentTypeContainer, AccessReference
{
/**
* covariant override
@@ -101,12 +101,6 @@ public interface MappingFile
MappingFile getParent();
/**
- * Return the specified access if present, otherwise return the default
- * access.
- */
- AccessType getAccess();
-
- /**
* Return the specified catalog if present, otherwise return the default
* catalog.
*/
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/MappingFilePersistenceUnitDefaults.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/MappingFilePersistenceUnitDefaults.java
index 389b952509..086ae4c0e1 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/MappingFilePersistenceUnitDefaults.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/MappingFilePersistenceUnitDefaults.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -22,7 +22,7 @@ package org.eclipse.jpt.jpa.core.context;
* @since 2.1
*/
public interface MappingFilePersistenceUnitDefaults
- extends JpaContextModel
+ extends AccessReference
{
/**
* Covariant override.
@@ -30,12 +30,6 @@ public interface MappingFilePersistenceUnitDefaults
MappingFilePersistenceUnitMetadata getParent();
/**
- * Return the access type for all managed classes in the persistence unit,
- * unless overridden by a local annotation or XML setting.
- */
- AccessType getAccess();
-
- /**
* Return the catalog for all database objects referenced in the
* persistence unit, unless overridden by a local annotation or XML setting.
* <p>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/orm/EntityMappings.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/orm/EntityMappings.java
index 2c6568b09f..c42365d2b2 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/orm/EntityMappings.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/orm/EntityMappings.java
@@ -94,6 +94,7 @@ public interface EntityMappings
SchemaContainer getDbSchemaContainer();
String getSpecifiedCatalog();
+ String CATALOG_PROPERTY = "catalog"; //$NON-NLS-1$
void setSpecifiedCatalog(String catalog);
String SPECIFIED_CATALOG_PROPERTY = "specifiedCatalog"; //$NON-NLS-1$
String getDefaultCatalog();
@@ -101,6 +102,7 @@ public interface EntityMappings
Catalog getDbCatalog();
String getSpecifiedSchema();
+ String SCHEMA_PROPERTY = "schema"; //$NON-NLS-1$
void setSpecifiedSchema(String schema);
String SPECIFIED_SCHEMA_PROPERTY = "specifiedSchema"; //$NON-NLS-1$
String getDefaultSchema();
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/orm/OrmPersistenceUnitDefaults.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/orm/OrmPersistenceUnitDefaults.java
index 69015dd1be..225d8f8106 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/orm/OrmPersistenceUnitDefaults.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/orm/OrmPersistenceUnitDefaults.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2006, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -43,6 +43,7 @@ public interface OrmPersistenceUnitDefaults
// ********** catalog **********
String getSpecifiedCatalog();
+ String CATALOG_PROPERTY = "catalog"; //$NON-NLS-1$
void setSpecifiedCatalog(String newSpecifiedCatalog);
String SPECIFIED_CATALOG_PROPERTY = "specifiedCatalog"; //$NON-NLS-1$
String getDefaultCatalog();
@@ -51,6 +52,7 @@ public interface OrmPersistenceUnitDefaults
// ********** schema **********
String getSpecifiedSchema();
+ String SCHEMA_PROPERTY = "schema"; //$NON-NLS-1$
void setSpecifiedSchema(String newSpecifiedSchema);
String SPECIFIED_SCHEMA_PROPERTY = "specifiedSchema"; //$NON-NLS-1$
String getDefaultSchema();
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaPersistentAttribute.java
index ea9a0db4c2..26d53c577c 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaPersistentAttribute.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaPersistentAttribute.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2015 Oracle. All rights reserved.
+ * Copyright (c) 2006, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -59,6 +59,7 @@ public abstract class AbstractJavaPersistentAttribute
protected AccessType defaultAccess;
protected AccessType specifiedAccess;
+ protected AccessType access;
protected JavaAttributeMapping mapping; // never null
protected String defaultMappingKey;
@@ -106,6 +107,7 @@ public abstract class AbstractJavaPersistentAttribute
@Override
public void update(IProgressMonitor monitor) {
super.update(monitor);
+ this.setAccess(this.buildAccess());
this.updateJpaContainerDefinition();
this.updateMapping(monitor);
}
@@ -151,8 +153,16 @@ public abstract class AbstractJavaPersistentAttribute
// ********** access **********
public AccessType getAccess() {
- AccessType access = this.getSpecifiedAccess();
- return (access != null) ? access : this.defaultAccess;
+ return this.access;
+ }
+
+ protected void setAccess(AccessType access) {
+ AccessType old = this.access;
+ this.firePropertyChanged(ACCESS_PROPERTY, old, this.access = access);
+ }
+
+ protected AccessType buildAccess() {
+ return (this.specifiedAccess != null) ? this.specifiedAccess : this.defaultAccess;
}
public AccessType getDefaultAccess() {
@@ -184,8 +194,7 @@ public abstract class AbstractJavaPersistentAttribute
protected void setSpecifiedAccess_(AccessType access) {
AccessType old = this.specifiedAccess;
- this.specifiedAccess = access;
- this.firePropertyChanged(SPECIFIED_ACCESS_PROPERTY, old, access);
+ this.firePropertyChanged(SPECIFIED_ACCESS_PROPERTY, old, this.specifiedAccess = access);
}
/**
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaPersistentType.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaPersistentType.java
index 4d19250f01..6e27ff2359 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaPersistentType.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaPersistentType.java
@@ -63,6 +63,7 @@ public abstract class AbstractJavaPersistentType
{
protected AccessType specifiedAccess;
protected AccessType defaultAccess; // never null
+ protected AccessType access; // never null
protected JavaTypeMapping mapping; // never null
@@ -98,6 +99,7 @@ public abstract class AbstractJavaPersistentType
public void update(IProgressMonitor monitor) {
super.update(monitor);
this.setDefaultAccess(this.buildDefaultAccess());
+ this.setAccess(this.buildAccess());
this.mapping.update(monitor);
this.updateAttributes(monitor);
this.updateStructureChildren();
@@ -137,6 +139,15 @@ public abstract class AbstractJavaPersistentType
// ********** access **********
public AccessType getAccess() {
+ return this.access;
+ }
+
+ protected void setAccess(AccessType access) {
+ AccessType old = this.access;
+ this.firePropertyChanged(ACCESS_PROPERTY, old, this.access = access);
+ }
+
+ protected AccessType buildAccess() {
return (this.specifiedAccess != null) ? this.specifiedAccess : this.defaultAccess;
}
@@ -154,8 +165,7 @@ public abstract class AbstractJavaPersistentType
protected void setSpecifiedAccess_(AccessType access) {
AccessType old = this.specifiedAccess;
- this.specifiedAccess = access;
- this.firePropertyChanged(SPECIFIED_ACCESS_PROPERTY, old, access);
+ this.firePropertyChanged(SPECIFIED_ACCESS_PROPERTY, old, this.specifiedAccess = access);
}
protected AccessType buildSpecifiedAccess() {
@@ -168,8 +178,7 @@ public abstract class AbstractJavaPersistentType
protected void setDefaultAccess(AccessType access) {
AccessType old = this.defaultAccess;
- this.defaultAccess = access;
- this.firePropertyChanged(DEFAULT_ACCESS_PROPERTY, old, access);
+ this.firePropertyChanged(DEFAULT_ACCESS_PROPERTY, old, this.defaultAccess = access);
}
/**
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractEntityMappings.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractEntityMappings.java
index 4a174907fc..3ecda969ee 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractEntityMappings.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractEntityMappings.java
@@ -106,12 +106,15 @@ public abstract class AbstractEntityMappings
protected AccessType specifiedAccess;
protected AccessType defaultAccess;
+ protected AccessType access;
protected String specifiedCatalog;
protected String defaultCatalog;
+ protected String catalog;
protected String specifiedSchema;
protected String defaultSchema;
+ protected String schema;
protected final OrmPersistenceUnitMetadata persistenceUnitMetadata;
@@ -181,8 +184,13 @@ public abstract class AbstractEntityMappings
super.update(monitor);
this.setDefaultAccess(this.buildDefaultAccess());
+ this.setAccess(this.buildAccess());
+
this.setDefaultCatalog(this.buildDefaultCatalog());
+ this.setCatalog(this.buildCatalog());
+
this.setDefaultSchema(this.buildDefaultSchema());
+ this.setSchema(this.buildSchema());
this.persistenceUnitMetadata.update(monitor);
@@ -376,6 +384,15 @@ public abstract class AbstractEntityMappings
// ********** access **********
public AccessType getAccess() {
+ return this.access;
+ }
+
+ protected void setAccess(AccessType access) {
+ AccessType old = this.access;
+ this.firePropertyChanged(ACCESS_PROPERTY, old, this.access = access);
+ }
+
+ protected AccessType buildAccess() {
return (this.specifiedAccess != null) ? this.specifiedAccess : this.defaultAccess;
}
@@ -390,8 +407,7 @@ public abstract class AbstractEntityMappings
protected void setSpecifiedAccess_(AccessType access) {
AccessType old = this.specifiedAccess;
- this.specifiedAccess = access;
- this.firePropertyChanged(SPECIFIED_ACCESS_PROPERTY, old, access);
+ this.firePropertyChanged(SPECIFIED_ACCESS_PROPERTY, old, this.specifiedAccess = access);
}
protected AccessType buildSpecifiedAccess() {
@@ -404,8 +420,7 @@ public abstract class AbstractEntityMappings
protected void setDefaultAccess(AccessType access) {
AccessType old = this.defaultAccess;
- this.defaultAccess = access;
- this.firePropertyChanged(DEFAULT_ACCESS_PROPERTY, old, access);
+ this.firePropertyChanged(DEFAULT_ACCESS_PROPERTY, old, this.defaultAccess = access);
}
protected AccessType buildDefaultAccess() {
@@ -416,6 +431,15 @@ public abstract class AbstractEntityMappings
// ********** catalog **********
public String getCatalog() {
+ return this.catalog;
+ }
+
+ protected void setCatalog(String catalog) {
+ String old = this.catalog;
+ this.firePropertyChanged(CATALOG_PROPERTY, old, this.catalog = catalog);
+ }
+
+ protected String buildCatalog() {
return (this.specifiedCatalog != null) ? this.specifiedCatalog : this.defaultCatalog;
}
@@ -430,8 +454,7 @@ public abstract class AbstractEntityMappings
protected void setSpecifiedCatalog_(String catalog) {
String old = this.specifiedCatalog;
- this.specifiedCatalog = catalog;
- this.firePropertyChanged(SPECIFIED_CATALOG_PROPERTY, old, catalog);
+ this.firePropertyChanged(SPECIFIED_CATALOG_PROPERTY, old, this.specifiedCatalog = catalog);
}
public String getDefaultCatalog() {
@@ -440,8 +463,7 @@ public abstract class AbstractEntityMappings
protected void setDefaultCatalog(String catalog) {
String old = this.defaultCatalog;
- this.defaultCatalog = catalog;
- this.firePropertyChanged(DEFAULT_CATALOG_PROPERTY, old, catalog);
+ this.firePropertyChanged(DEFAULT_CATALOG_PROPERTY, old, this.defaultCatalog = catalog);
}
protected String buildDefaultCatalog() {
@@ -453,14 +475,23 @@ public abstract class AbstractEntityMappings
* catalog), then the database probably does not support catalogs.
*/
public Catalog getDbCatalog() {
- String catalog = this.getCatalog();
- return (catalog == null) ? null : this.resolveDbCatalog(catalog);
+ String catalogString = this.getCatalog();
+ return (catalogString == null) ? null : this.resolveDbCatalog(catalogString);
}
// ********** schema **********
public String getSchema() {
+ return this.schema;
+ }
+
+ protected void setSchema(String schema) {
+ String old = this.schema;
+ this.firePropertyChanged(SCHEMA_PROPERTY, old, this.schema = schema);
+ }
+
+ protected String buildSchema() {
return (this.specifiedSchema != null) ? this.specifiedSchema : this.defaultSchema;
}
@@ -475,8 +506,7 @@ public abstract class AbstractEntityMappings
protected void setSpecifiedSchema_(String schema) {
String old = this.specifiedSchema;
- this.specifiedSchema = schema;
- this.firePropertyChanged(SPECIFIED_SCHEMA_PROPERTY, old, schema);
+ this.firePropertyChanged(SPECIFIED_SCHEMA_PROPERTY, old, this.specifiedSchema = schema);
}
public String getDefaultSchema() {
@@ -485,8 +515,7 @@ public abstract class AbstractEntityMappings
protected void setDefaultSchema(String schema) {
String old = this.defaultSchema;
- this.defaultSchema = schema;
- this.firePropertyChanged(DEFAULT_SCHEMA_PROPERTY, old, schema);
+ this.firePropertyChanged(DEFAULT_SCHEMA_PROPERTY, old, this.defaultSchema = schema);
}
protected String buildDefaultSchema() {
@@ -507,8 +536,8 @@ public abstract class AbstractEntityMappings
* get the schema directly from the database.
*/
public SchemaContainer getDbSchemaContainer() {
- String catalog = this.getCatalog();
- return (catalog != null) ? this.resolveDbCatalog(catalog) : this.getDatabase();
+ String catalogString = this.getCatalog();
+ return (catalogString != null) ? this.resolveDbCatalog(catalogString) : this.getDatabase();
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmPersistentAttribute.java
index 7f70d67f7b..9d0614407c 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmPersistentAttribute.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmPersistentAttribute.java
@@ -78,6 +78,7 @@ public abstract class AbstractOrmPersistentAttribute
protected AccessType specifiedAccess;
protected AccessType defaultAccess;
+ protected AccessType access;
protected AbstractOrmPersistentAttribute(OrmPersistentType parent, XmlAttributeMapping xmlMapping) {
@@ -103,6 +104,7 @@ public abstract class AbstractOrmPersistentAttribute
public void update(IProgressMonitor monitor) {
super.update(monitor);
this.setDefaultAccess(this.buildDefaultAccess());
+ this.setAccess(this.buildAccess());
this.setJavaPersistentAttribute(this.buildJavaPersistentAttribute());
this.mapping.update(monitor);
if (this.cachedJavaPersistentAttribute != null) {
@@ -354,8 +356,23 @@ public abstract class AbstractOrmPersistentAttribute
// ********** access **********
public AccessType getAccess() {
- AccessType access = this.getSpecifiedAccess();
- return (access != null) ? access : this.defaultAccess;
+ return this.access;
+ }
+
+ protected void setAccess(AccessType access) {
+ if (access != this.access) {
+ AccessType old = this.access;
+ this.firePropertyChanged(ACCESS_PROPERTY, old, this.access = access);
+ // clear out the cached 'javaAttribute' is the access has changed, it will no longer apply
+ if (this.cachedJavaPersistentAttribute != null) {
+ this.setJavaPersistentAttribute(null);
+ this.cachedJavaPersistentAttribute = null;
+ }
+ }
+ }
+
+ protected AccessType buildAccess() {
+ return (this.specifiedAccess != null) ? this.specifiedAccess : this.defaultAccess;
}
public AccessType getDefaultAccess() {
@@ -390,17 +407,8 @@ public abstract class AbstractOrmPersistentAttribute
}
protected void setSpecifiedAccess_(AccessType access) {
- AccessType oldAccess = this.getAccess();
- AccessType oldSpecifiedAccess = this.specifiedAccess;
- this.specifiedAccess = access;
- this.firePropertyChanged(SPECIFIED_ACCESS_PROPERTY, oldSpecifiedAccess, access);
- if (oldAccess != this.getAccess()) {
- //clear out the cached 'javaAttribute' is the access has changed, it will no longer apply
- if (this.cachedJavaPersistentAttribute != null) {
- this.setJavaPersistentAttribute(null);
- this.cachedJavaPersistentAttribute = null;
- }
- }
+ AccessType old = this.specifiedAccess;
+ this.firePropertyChanged(SPECIFIED_ACCESS_PROPERTY, old, this.specifiedAccess = access);
}
protected AccessType buildSpecifiedAccess() {
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/SpecifiedOrmPersistentType.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/SpecifiedOrmPersistentType.java
index e67c279a65..92a6e14767 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/SpecifiedOrmPersistentType.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/SpecifiedOrmPersistentType.java
@@ -89,6 +89,7 @@ public abstract class SpecifiedOrmPersistentType
protected AccessType specifiedAccess;
protected AccessType defaultAccess; // never null
+ protected AccessType access; // never null
protected final Vector<OrmSpecifiedPersistentAttribute> specifiedAttributes = new Vector<>();
protected final SpecifiedAttributeContainerAdapter specifiedAttributeContainerAdapter = new SpecifiedAttributeContainerAdapter();
@@ -129,6 +130,7 @@ public abstract class SpecifiedOrmPersistentType
super.update(monitor);
this.mapping.update(monitor);
this.setDefaultAccess(this.buildDefaultAccess());
+ this.setAccess(this.buildAccess());
this.updateModels(this.getSpecifiedAttributes(), monitor);
this.updateDefaultAttributes(monitor);
this.setDeclaringTypeName(this.buildDeclaringTypeName());
@@ -197,6 +199,15 @@ public abstract class SpecifiedOrmPersistentType
// ********** access **********
public AccessType getAccess() {
+ return this.access;
+ }
+
+ protected void setAccess(AccessType access) {
+ AccessType old = this.access;
+ this.firePropertyChanged(ACCESS_PROPERTY, old, this.access = access);
+ }
+
+ protected AccessType buildAccess() {
return (this.specifiedAccess != null) ? this.specifiedAccess : this.defaultAccess;
}
@@ -211,8 +222,7 @@ public abstract class SpecifiedOrmPersistentType
protected void setSpecifiedAccess_(AccessType access) {
AccessType old = this.specifiedAccess;
- this.specifiedAccess = access;
- this.firePropertyChanged(SPECIFIED_ACCESS_PROPERTY, old, access);
+ this.firePropertyChanged(SPECIFIED_ACCESS_PROPERTY, old, this.specifiedAccess = access);
}
protected AccessType buildSpecifiedAccess() {
@@ -225,8 +235,7 @@ public abstract class SpecifiedOrmPersistentType
protected void setDefaultAccess(AccessType access) {
AccessType old = this.defaultAccess;
- this.defaultAccess = access;
- this.firePropertyChanged(DEFAULT_ACCESS_PROPERTY, old, access);
+ this.firePropertyChanged(DEFAULT_ACCESS_PROPERTY, old, this.defaultAccess = access);
}
protected AccessType buildDefaultAccess() {
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 c133c07e18..8c9a483087 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2015 Oracle. All rights reserved.
+ * Copyright (c) 2006, 2016 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -34,12 +34,15 @@ public abstract class AbstractOrmPersistenceUnitDefaults
implements OrmPersistenceUnitDefaults2_0
{
protected AccessType specifiedAccess;
+ protected AccessType access;
protected String specifiedCatalog;
protected String defaultCatalog;
+ protected String catalog;
protected String specifiedSchema;
protected String defaultSchema;
+ protected String schema;
protected boolean cascadePersist;
@@ -77,15 +80,30 @@ public abstract class AbstractOrmPersistenceUnitDefaults
@Override
public void update(IProgressMonitor monitor) {
super.update(monitor);
+
+ this.setAccess(this.buildAccess());
+
this.setDefaultCatalog(this.buildDefaultCatalog());
+ this.setCatalog(this.buildCatalog());
+
this.setDefaultSchema(this.buildDefaultSchema());
+ this.setSchema(this.buildSchema());
}
// ********** access **********
public AccessType getAccess() {
- return this.getSpecifiedAccess();
+ return this.access;
+ }
+
+ protected void setAccess(AccessType access) {
+ AccessType old = this.access;
+ this.firePropertyChanged(ACCESS_PROPERTY, old, this.access = access);
+ }
+
+ protected AccessType buildAccess() {
+ return this.specifiedAccess;
}
public AccessType getDefaultAccess() {
@@ -107,8 +125,7 @@ public abstract class AbstractOrmPersistenceUnitDefaults
protected void setSpecifiedAccess_(AccessType access) {
AccessType old = this.specifiedAccess;
- this.specifiedAccess = access;
- this.firePropertyChanged(SPECIFIED_ACCESS_PROPERTY, old, access);
+ this.firePropertyChanged(SPECIFIED_ACCESS_PROPERTY, old, this.specifiedAccess = access);
}
protected AccessType buildSpecifiedAccess() {
@@ -125,14 +142,23 @@ public abstract class AbstractOrmPersistenceUnitDefaults
* get the schema directly from the database.
*/
public SchemaContainer getDbSchemaContainer() {
- String catalog = this.getCatalog();
- return (catalog != null) ? this.resolveDbCatalog(catalog) : this.getDatabase();
+ String catalogString = this.getCatalog();
+ return (catalogString != null) ? this.resolveDbCatalog(catalogString) : this.getDatabase();
}
// ********** catalog **********
public String getCatalog() {
+ return this.catalog;
+ }
+
+ protected void setCatalog(String catalog) {
+ String old = this.catalog;
+ this.firePropertyChanged(CATALOG_PROPERTY, old, this.catalog = catalog);
+ }
+
+ protected String buildCatalog() {
return (this.specifiedCatalog != null) ? this.specifiedCatalog : this.defaultCatalog;
}
@@ -151,8 +177,7 @@ public abstract class AbstractOrmPersistenceUnitDefaults
protected void setSpecifiedCatalog_(String catalog) {
String old = this.specifiedCatalog;
- this.specifiedCatalog = catalog;
- this.firePropertyChanged(SPECIFIED_CATALOG_PROPERTY, old, catalog);
+ this.firePropertyChanged(SPECIFIED_CATALOG_PROPERTY, old, this.specifiedCatalog = catalog);
}
protected String buildSpecifiedCatalog() {
@@ -166,8 +191,7 @@ public abstract class AbstractOrmPersistenceUnitDefaults
protected void setDefaultCatalog(String catalog) {
String old = this.defaultCatalog;
- this.defaultCatalog = catalog;
- this.firePropertyChanged(DEFAULT_CATALOG_PROPERTY, old, catalog);
+ this.firePropertyChanged(DEFAULT_CATALOG_PROPERTY, old, this.defaultCatalog = catalog);
}
protected String buildDefaultCatalog() {
@@ -179,14 +203,23 @@ public abstract class AbstractOrmPersistenceUnitDefaults
* catalog), then the database probably does not support catalogs.
*/
public Catalog getDbCatalog() {
- String catalog = this.getCatalog();
- return (catalog == null) ? null : this.resolveDbCatalog(catalog);
+ String catalogString = this.getCatalog();
+ return (catalogString == null) ? null : this.resolveDbCatalog(catalogString);
}
// ********** schema **********
public String getSchema() {
+ return this.schema;
+ }
+
+ protected void setSchema(String schema) {
+ String old = this.schema;
+ this.firePropertyChanged(SCHEMA_PROPERTY, old, this.schema = schema);
+ }
+
+ protected String buildSchema() {
return (this.specifiedSchema != null) ? this.specifiedSchema : this.defaultSchema;
}
@@ -205,8 +238,7 @@ public abstract class AbstractOrmPersistenceUnitDefaults
protected void setSpecifiedSchema_(String schema) {
String old = this.specifiedSchema;
- this.specifiedSchema = schema;
- this.firePropertyChanged(SPECIFIED_SCHEMA_PROPERTY, old, schema);
+ this.firePropertyChanged(SPECIFIED_SCHEMA_PROPERTY, old, this.specifiedSchema = schema);
}
protected String buildSpecifiedSchema() {
@@ -220,8 +252,7 @@ public abstract class AbstractOrmPersistenceUnitDefaults
protected void setDefaultSchema(String schema) {
String old = this.defaultSchema;
- this.defaultSchema = schema;
- this.firePropertyChanged(DEFAULT_SCHEMA_PROPERTY, old, schema);
+ this.firePropertyChanged(DEFAULT_SCHEMA_PROPERTY, old, this.defaultSchema = schema);
}
protected String buildDefaultSchema() {
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmAttributeTypeClassChooser.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmAttributeTypeClassChooser.java
index aca22d14bb..abb5cf8b82 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmAttributeTypeClassChooser.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmAttributeTypeClassChooser.java
@@ -17,6 +17,7 @@ import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter
import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelTools;
import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
+import org.eclipse.jpt.jpa.core.context.AccessReference;
import org.eclipse.jpt.jpa.core.context.AttributeMapping;
import org.eclipse.jpt.jpa.core.context.SpecifiedAccessReference;
import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
@@ -100,22 +101,10 @@ public class EclipseLinkOrmAttributeTypeClassChooser
}
private static PropertyValueModel<Boolean> buildVirtualAttributeModel(PropertyValueModel<? extends AttributeMapping> mappingModel) {
- return new PropertyAspectAdapterXXXX<SpecifiedAccessReference, Boolean>(
- buildAccessReferenceModel(mappingModel),
- SpecifiedAccessReference.SPECIFIED_ACCESS_PROPERTY,
- SpecifiedAccessReference.DEFAULT_ACCESS_PROPERTY) {
- @Override
- protected Boolean buildValue() {
- if (this.subject == null) {
- return Boolean.FALSE;
- }
- return this.buildValue_();
- }
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.getAccess() == EclipseLinkAccessType.VIRTUAL);
- }
- };
+ return PropertyValueModelTools.subjectModelAspectAdapter_(
+ buildAccessReferenceModel(mappingModel),
+ AccessReference.ACCESS_PROPERTY,
+ m -> Boolean.valueOf((m != null) && (m.getAccess() == EclipseLinkAccessType.VIRTUAL))
+ );
}
-
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnJoiningStrategyPane.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnJoiningStrategyPane.java
index b9d7ef7395..d0a06437c4 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnJoiningStrategyPane.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnJoiningStrategyPane.java
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jpa.ui.internal.details;
import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapterXXXX;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelTools;
import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
@@ -123,24 +122,15 @@ public class JoinColumnJoiningStrategyPane
}
public static ModifiablePropertyValueModel<Boolean> buildUsesJoinColumnJoiningStrategyModel(PropertyValueModel<? extends JoinColumnRelationship> subjectHolder) {
- return new PropertyAspectAdapterXXXX<JoinColumnRelationship, Boolean>(
- subjectHolder, Relationship.STRATEGY_PROPERTY) {
- @Override
- protected Boolean buildValue() {
- return Boolean.valueOf(this.buildBooleanValue());
- }
-
- protected boolean buildBooleanValue() {
- return (this.subject != null) && this.subject.strategyIsJoinColumn();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value == Boolean.TRUE) {
- ((SpecifiedJoinColumnRelationship) this.subject).setStrategyToJoinColumn();
+ return PropertyValueModelTools.modifiableSubjectModelAspectAdapter_(
+ subjectHolder,
+ Relationship.STRATEGY_PROPERTY,
+ m -> Boolean.valueOf((m != null) && m.strategyIsJoinColumn()),
+ (m, value) -> {
+ if ((m != null) && (value != null) && value.booleanValue()) {
+ ((SpecifiedJoinColumnRelationship) m).setStrategyToJoinColumn();
+ }
}
- //value == FALSE - selection of another radio button causes this strategy to get unset
- }
- };
+ );
}
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinTableJoiningStrategyPane.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinTableJoiningStrategyPane.java
index 5f57f23af2..88f9a4945b 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinTableJoiningStrategyPane.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinTableJoiningStrategyPane.java
@@ -87,25 +87,16 @@ public class JoinTableJoiningStrategyPane
}
public static ModifiablePropertyValueModel<Boolean> buildUsesJoinTableJoiningStrategyModel(PropertyValueModel<? extends JoinTableRelationship> subjectHolder) {
- return new PropertyAspectAdapterXXXX<JoinTableRelationship, Boolean>(
- subjectHolder, Relationship.STRATEGY_PROPERTY) {
- @Override
- protected Boolean buildValue() {
- return Boolean.valueOf(this.buildBooleanValue());
- }
-
- protected boolean buildBooleanValue() {
- return (this.subject != null) && this.subject.strategyIsJoinTable();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value == Boolean.TRUE) {
- ((SpecifiedJoinTableRelationship) this.subject).setStrategyToJoinTable();
+ return PropertyValueModelTools.modifiableSubjectModelAspectAdapter_(
+ subjectHolder,
+ Relationship.STRATEGY_PROPERTY,
+ m -> Boolean.valueOf((m != null) && m.strategyIsJoinTable()),
+ (m, value) -> {
+ if ((m != null) && (value != null) && value.booleanValue()) {
+ ((SpecifiedJoinTableRelationship) m).setStrategyToJoinTable();
+ }
}
- //value == FALSE - selection of another radio button causes this strategy to get unset
- }
- };
+ );
}
private PropertyValueModel<Boolean> buildJoinTablePaneEnablerModel() {
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ManyToManyJoiningStrategyPane.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ManyToManyJoiningStrategyPane.java
index 54ac8d34f4..df36b15759 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ManyToManyJoiningStrategyPane.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ManyToManyJoiningStrategyPane.java
@@ -10,13 +10,11 @@
package org.eclipse.jpt.jpa.ui.internal.details;
import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapterXXXX;
+import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelTools;
import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.jpa.core.context.ManyToManyRelationship;
-import org.eclipse.jpt.jpa.core.context.MappedByRelationship;
import org.eclipse.jpt.jpa.core.context.Relationship;
-import org.eclipse.jpt.jpa.core.context.SpecifiedJoinTableRelationship;
import org.eclipse.jpt.jpa.ui.details.JptJpaUiDetailsMessages;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -93,40 +91,28 @@ public class ManyToManyJoiningStrategyPane
}
protected ModifiablePropertyValueModel<Boolean> buildUsesMappedByStrategyModel() {
- return new PropertyAspectAdapterXXXX<MappedByRelationship, Boolean>(
- this.getSubjectHolder(), Relationship.STRATEGY_PROPERTY) {
- @Override
- protected Boolean buildValue() {
- return (this.subject == null) ? Boolean.FALSE :
- Boolean.valueOf(this.subject.strategyIsMappedBy());
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value == Boolean.TRUE) {
- this.subject.setStrategyToMappedBy();
+ return PropertyValueModelTools.modifiableSubjectModelAspectAdapter_(
+ this.getSubjectHolder(),
+ Relationship.STRATEGY_PROPERTY,
+ m -> Boolean.valueOf((m != null) && m.strategyIsMappedBy()),
+ (m, value) -> {
+ if ((m != null) && (value != null) && value.booleanValue()) {
+ m.setStrategyToMappedBy();
+ }
}
- //value == FALSE - selection of another radio button causes this strategy to get unset
- }
- };
+ );
}
protected ModifiablePropertyValueModel<Boolean> buildUsesJoinTableStrategyModel() {
- return new PropertyAspectAdapterXXXX<SpecifiedJoinTableRelationship, Boolean>(
- this.getSubjectHolder(), Relationship.STRATEGY_PROPERTY) {
- @Override
- protected Boolean buildValue() {
- return (this.subject == null) ? Boolean.FALSE :
- Boolean.valueOf(this.subject.strategyIsJoinTable());
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value == Boolean.TRUE) {
- this.subject.setStrategyToJoinTable();
+ return PropertyValueModelTools.modifiableSubjectModelAspectAdapter_(
+ this.getSubjectHolder(),
+ Relationship.STRATEGY_PROPERTY,
+ m -> Boolean.valueOf((m != null) && m.strategyIsJoinTable()),
+ (m, value) -> {
+ if ((m != null) && (value != null) && value.booleanValue()) {
+ m.setStrategyToJoinTable();
+ }
}
- //value == FALSE - selection of another radio button causes this strategy to get unset
- }
- };
+ );
}
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/MappedByJoiningStrategyPane.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/MappedByJoiningStrategyPane.java
index 1b9bc937c7..c2d969d36b 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/MappedByJoiningStrategyPane.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/MappedByJoiningStrategyPane.java
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jpa.ui.internal.details;
import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapterXXXX;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelTools;
import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
@@ -72,22 +71,16 @@ public class MappedByJoiningStrategyPane
}
public static ModifiablePropertyValueModel<Boolean> buildUsesMappedByJoiningStrategyModel(PropertyValueModel<? extends MappedByRelationship> subjectHolder) {
- return new PropertyAspectAdapterXXXX<MappedByRelationship, Boolean>(
- subjectHolder, Relationship.STRATEGY_PROPERTY) {
- @Override
- protected Boolean buildValue() {
- return (this.subject == null) ? Boolean.FALSE :
- Boolean.valueOf(this.subject.strategyIsMappedBy());
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value == Boolean.TRUE) {
- this.subject.setStrategyToMappedBy();
+ return PropertyValueModelTools.modifiableSubjectModelAspectAdapter_(
+ subjectHolder,
+ Relationship.STRATEGY_PROPERTY,
+ m -> Boolean.valueOf((m != null) && m.strategyIsMappedBy()),
+ (m, value) -> {
+ if ((m != null) && (value != null) && value.booleanValue()) {
+ m.setStrategyToMappedBy();
+ }
}
- //value == FALSE - selection of another radio button causes this strategy to get unset
- }
- };
+ );
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnJoiningStrategyPane.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnJoiningStrategyPane.java
index 61dd74a248..d4978af07d 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnJoiningStrategyPane.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnJoiningStrategyPane.java
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jpa.ui.internal.details;
import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapterXXXX;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelTools;
import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
@@ -55,21 +54,15 @@ public class PrimaryKeyJoinColumnJoiningStrategyPane
}
public static ModifiablePropertyValueModel<Boolean> buildUsesPrimaryKeyJoinColumnJoiningStrategyModel(PropertyValueModel<? extends PrimaryKeyJoinColumnRelationship> subjectHolder) {
- return new PropertyAspectAdapterXXXX<PrimaryKeyJoinColumnRelationship, Boolean>(
- subjectHolder, Relationship.STRATEGY_PROPERTY) {
- @Override
- protected Boolean buildValue() {
- return (this.subject == null) ? Boolean.FALSE :
- Boolean.valueOf(this.subject.strategyIsPrimaryKeyJoinColumn());
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value == Boolean.TRUE) {
- this.subject.setStrategyToPrimaryKeyJoinColumn();
+ return PropertyValueModelTools.modifiableSubjectModelAspectAdapter_(
+ subjectHolder,
+ Relationship.STRATEGY_PROPERTY,
+ m -> Boolean.valueOf((m != null) && m.strategyIsPrimaryKeyJoinColumn()),
+ (m, value) -> {
+ if ((m != null) && (value != null) && value.booleanValue()) {
+ m.setStrategyToPrimaryKeyJoinColumn();
+ }
}
- //value == FALSE - selection of another radio button causes this strategy to get unset
- }
- };
+ );
}
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/DerivedIdentityPane2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/DerivedIdentityPane2_0.java
index 95b2720227..ca616d9081 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/DerivedIdentityPane2_0.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/DerivedIdentityPane2_0.java
@@ -120,22 +120,16 @@ public class DerivedIdentityPane2_0
}
protected ModifiablePropertyValueModel<Boolean> buildUsesMapsIdDerivedIdentityStrategyHolder() {
- return new PropertyAspectAdapterXXXX<DerivedIdentity2_0, Boolean>(
- getSubjectHolder(), DerivedIdentity2_0.PREDOMINANT_DERIVED_IDENTITY_STRATEGY_PROPERTY) {
-
- @Override
- protected Boolean buildValue() {
- return (this.subject == null) ? Boolean.FALSE : this.subject.usesMapsIdDerivedIdentityStrategy();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- // radio button - should only have true values here
- if (value) {
- this.subject.setMapsIdDerivedIdentityStrategy();
+ return PropertyValueModelTools.modifiableSubjectModelAspectAdapter_(
+ this.getSubjectHolder(),
+ DerivedIdentity2_0.PREDOMINANT_DERIVED_IDENTITY_STRATEGY_PROPERTY,
+ m -> Boolean.valueOf((m != null) && m.usesMapsIdDerivedIdentityStrategy()),
+ (m, value) -> {
+ if ((m != null) && (value != null) && value.booleanValue()) {
+ m.setMapsIdDerivedIdentityStrategy();
+ }
}
- }
- };
+ );
}
protected ComboPane buildMapsIdValueComboPane(Composite parent, PropertyValueModel<Boolean> usesMapsIdModel) {

Back to the top