Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Vosburgh2016-09-02 01:54:45 +0000
committerBrian Vosburgh2017-05-18 22:39:11 +0000
commit6fb9675bb422ae08f19da32e64912930a1ef37bd (patch)
tree35f5b365cb4beeb2dfa06e1688f2af3882fa82c7
parent1de7a4bedd238bfbd3005c2463f52b1358e12d3b (diff)
downloadwebtools.dali-6fb9675bb422ae08f19da32e64912930a1ef37bd.tar.gz
webtools.dali-6fb9675bb422ae08f19da32e64912930a1ef37bd.tar.xz
webtools.dali-6fb9675bb422ae08f19da32e64912930a1ef37bd.zip
added SchemaReference, SpecifiedSchemaReference, and
ModifiableSpecifiedSchemaReference
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/MappingFile.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/MappingFilePersistenceUnitDefaults.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/ModifiableSpecifiedSchemaReference.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/SchemaReference.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/SpecifiedSchemaReference.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/SpecifiedTable.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/Table.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/TableGenerator.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/orm/EntityMappings.java18
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/orm/OrmPersistenceUnitDefaults.java22
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaTable.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaVirtualTable.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractEntityMappings.java114
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmTable.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmVirtualTable.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJavaTableGenerator.java119
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/AbstractOrmPersistenceUnitDefaults.java137
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/GenericOrmTableGenerator.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/java/GenericJavaSequenceGenerator2_0.java113
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/GenericOrmSequenceGenerator2_0.java113
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2/context/SequenceGenerator2_0.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ReferenceTableComposite.java17
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TableComposite.java19
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TableGeneratorComposite.java17
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractEntityMappingsDetailsPageManager.java13
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/PersistenceUnitMetadataComposite.java16
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/SequenceGeneratorComposite2_0.java17
27 files changed, 827 insertions, 562 deletions
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 e3fe80986b..46224dc512 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
@@ -93,7 +93,7 @@ public interface MappingFile
* Common interface for the root of a mapping file.
*/
interface Root
- extends JpaStructureNode, PersistentTypeContainer, AccessReference
+ extends JpaStructureNode, PersistentTypeContainer, AccessReference, SchemaReference
{
/**
* covariant override
@@ -101,18 +101,6 @@ public interface MappingFile
MappingFile getParent();
/**
- * Return the specified catalog if present, otherwise return the default
- * catalog.
- */
- String getCatalog();
-
- /**
- * Return the specified schema if present, otherwise return the default
- * schema.
- */
- String getSchema();
-
- /**
* Return the metadata defined within the mapping file
* <em>for the persistence unit</em>.
* Return <code>null</code> if none exists.
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 086ae4c0e1..7f96e9092b 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
@@ -22,7 +22,7 @@ package org.eclipse.jpt.jpa.core.context;
* @since 2.1
*/
public interface MappingFilePersistenceUnitDefaults
- extends AccessReference
+ extends AccessReference, SchemaReference
{
/**
* Covariant override.
@@ -30,26 +30,9 @@ public interface MappingFilePersistenceUnitDefaults
MappingFilePersistenceUnitMetadata getParent();
/**
- * Return the catalog for all database objects referenced in the
- * persistence unit, unless overridden by a local annotation or XML setting.
- * <p>
- * Return the specified catalog if present, otherwise return the
- * default catalog as determined by the database connection.
- */
- String getCatalog();
-
- /**
- * Return the schema for all database objects referenced in the
- * persistence unit, unless overridden by a local annotation or XML setting.
- * <p>
- * Return the specified schema if present, otherwise return the
- * default schema as determined by the database connection.
- */
- String getSchema();
-
- /**
* Return all the relationhips in the persistence unit are to be cascade
* persist, unless overridden by a local annotation or XML setting.
*/
boolean isCascadePersist();
+ String CASCADE_PERSIST_PROPERTY = "cascadePersist"; //$NON-NLS-1$
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/ModifiableSpecifiedSchemaReference.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/ModifiableSpecifiedSchemaReference.java
new file mode 100644
index 0000000000..b70fad7538
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/ModifiableSpecifiedSchemaReference.java
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * 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.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jpa.core.context;
+
+/**
+ * Common interface that can be used by clients interested in only an object's
+ * schema and/or catalog (e.g. a UI composite).
+ * <p>
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 2.2
+ * @since 2.2
+ */
+public interface ModifiableSpecifiedSchemaReference
+ extends SpecifiedSchemaReference
+{
+ void setSpecifiedSchema(String schema);
+ void setSpecifiedCatalog(String catalog);
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/SchemaReference.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/SchemaReference.java
new file mode 100644
index 0000000000..bb0849d00c
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/SchemaReference.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * 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.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jpa.core.context;
+
+/**
+ * Common interface that can be used by clients interested in only an object's
+ * schema and/or catalog (e.g. a UI composite).
+ * <p>
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 3.7
+ * @since 3.7
+ */
+public interface SchemaReference
+ extends JpaContextModel
+{
+ /**
+ * Return the schema, whether specified or defaulted.
+ */
+ String getSchema();
+ String SCHEMA_PROPERTY = "schema"; //$NON-NLS-1$
+
+ /**
+ * Return the catalog, whether specified or defaulted.
+ */
+ String getCatalog();
+ String CATALOG_PROPERTY = "catalog"; //$NON-NLS-1$
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/SpecifiedSchemaReference.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/SpecifiedSchemaReference.java
new file mode 100644
index 0000000000..333eca99be
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/SpecifiedSchemaReference.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * 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.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jpa.core.context;
+
+/**
+ * Common interface that can be used by clients interested in only an object's
+ * schema and/or catalog (e.g. a UI composite).
+ * <p>
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 2.2
+ * @since 2.2
+ */
+public interface SpecifiedSchemaReference
+ extends SchemaReference
+{
+ String getSpecifiedSchema();
+ String SPECIFIED_SCHEMA_PROPERTY = "specifiedSchema"; //$NON-NLS-1$
+ String getDefaultSchema();
+ String DEFAULT_SCHEMA_PROPERTY = "defaultSchema"; //$NON-NLS-1$
+
+ String getSpecifiedCatalog();
+ String SPECIFIED_CATALOG_PROPERTY = "specifiedCatalog"; //$NON-NLS-1$
+ String getDefaultCatalog();
+ String DEFAULT_CATALOG_PROPERTY = "defaultCatalog"; //$NON-NLS-1$
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/SpecifiedTable.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/SpecifiedTable.java
index 24f57028fc..2164c0551b 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/SpecifiedTable.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/SpecifiedTable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2013 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.
@@ -30,14 +30,10 @@ import org.eclipse.jpt.common.utility.iterable.ListIterable;
* @since 2.0
*/
public interface SpecifiedTable
- extends Table
+ extends Table, ModifiableSpecifiedSchemaReference
{
void setSpecifiedName(String value);
- void setSpecifiedSchema(String value);
-
- void setSpecifiedCatalog(String value);
-
ListIterable<? extends SpecifiedUniqueConstraint> getUniqueConstraints();
SpecifiedUniqueConstraint getUniqueConstraint(int index);
SpecifiedUniqueConstraint addUniqueConstraint();
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/Table.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/Table.java
index 10a8543c2c..b7ec7c8a53 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/Table.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/Table.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2013 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.
@@ -32,7 +32,7 @@ import org.eclipse.jpt.jpa.db.SchemaContainer;
* will almost certainly be broken (repeatedly) as the API evolves.
*/
public interface Table
- extends JpaContextModel
+ extends SpecifiedSchemaReference
{
// ********** name **********
@@ -41,6 +41,7 @@ public interface Table
* name.
*/
String getName();
+ String NAME_PROPERTY = "name"; //$NON-NLS-1$
Transformer<Table, String> NAME_TRANSFORMER = new NameTransformer();
class NameTransformer
extends TransformerAdapter<Table, String>
@@ -80,16 +81,6 @@ public interface Table
// ********** schema **********
/**
- * Return the specified schema if present, otherwise return the default
- * schema.
- */
- String getSchema();
- String getSpecifiedSchema();
- String SPECIFIED_SCHEMA_PROPERTY = "specifiedSchema"; //$NON-NLS-1$
- String getDefaultSchema();
- String DEFAULT_SCHEMA_PROPERTY = "defaultSchema"; //$NON-NLS-1$
-
- /**
* Return whether the table's schema can be resolved to a schema on the
* database.
*/
@@ -106,16 +97,6 @@ public interface Table
// ********** catalog **********
/**
- * Return the specified catalog if present, otherwise return the default
- * catalog.
- */
- String getCatalog();
- String getSpecifiedCatalog();
- String SPECIFIED_CATALOG_PROPERTY = "specifiedCatalog"; //$NON-NLS-1$
- String getDefaultCatalog();
- String DEFAULT_CATALOG_PROPERTY = "defaultCatalog"; //$NON-NLS-1$
-
- /**
* Return whether the table has a catalog and it can be resolved to a
* catalog on the database.
*/
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/TableGenerator.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/TableGenerator.java
index 9ddc07adc9..1e173e02d5 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/TableGenerator.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/TableGenerator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2013 Oracle. All rights reserved.
+ * Copyright (c) 2007, 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.
@@ -24,7 +24,7 @@ import org.eclipse.jpt.jpa.db.Table;
* @since 2.0
*/
public interface TableGenerator
- extends DatabaseGenerator
+ extends DatabaseGenerator, ModifiableSpecifiedSchemaReference
{
int DEFAULT_INITIAL_VALUE = 0;
@@ -37,6 +37,7 @@ public interface TableGenerator
* table name.
*/
String getTableName();
+ String TABLE_NAME_PROPERTY = "tableName"; //$NON-NLS-1$
String getSpecifiedTableName();
void setSpecifiedTableName(String tableName);
String SPECIFIED_TABLE_NAME_PROPERTY = "specifiedTableName"; //$NON-NLS-1$
@@ -44,34 +45,6 @@ public interface TableGenerator
String DEFAULT_TABLE_NAME_PROPERTY = "defaultTableName"; //$NON-NLS-1$
- // ********** schema **********
-
- /**
- * Return the specified schema if present, otherwise return the default
- * schema.
- */
- String getSchema();
- String getSpecifiedSchema();
- void setSpecifiedSchema(String value);
- String SPECIFIED_SCHEMA_PROPERTY = "specifiedSchema"; //$NON-NLS-1$
- String getDefaultSchema();
- String DEFAULT_SCHEMA_PROPERTY = "defaultSchema"; //$NON-NLS-1$
-
-
- // ********** catalog **********
-
- /**
- * Return the specified catalog if present, otherwise return the default
- * catalog.
- */
- String getCatalog();
- String getSpecifiedCatalog();
- void setSpecifiedCatalog(String value);
- String SPECIFIED_CATALOG_PROPERTY = "specifiedCatalog"; //$NON-NLS-1$
- String getDefaultCatalog();
- String DEFAULT_CATALOG_PROPERTY = "defaultCatalog"; //$NON-NLS-1$
-
-
// ********** primary key column name **********
/**
@@ -79,6 +52,7 @@ public interface TableGenerator
* the default primary key colum name.
*/
String getPkColumnName();
+ String PK_COLUMN_NAME_PROPERTY = "pkColumnName"; //$NON-NLS-1$
String getSpecifiedPkColumnName();
void setSpecifiedPkColumnName(String value);
String SPECIFIED_PK_COLUMN_NAME_PROPERTY = "specifiedPkColumnName"; //$NON-NLS-1$
@@ -93,6 +67,7 @@ public interface TableGenerator
* the default value colum name.
*/
String getValueColumnName();
+ String VALUE_COLUMN_NAME_PROPERTY = "valueColumnName"; //$NON-NLS-1$
String getSpecifiedValueColumnName();
void setSpecifiedValueColumnName(String value);
String SPECIFIED_VALUE_COLUMN_NAME_PROPERTY = "specifiedValueColumnName"; //$NON-NLS-1$
@@ -107,6 +82,7 @@ public interface TableGenerator
* the default primary key colum value.
*/
String getPkColumnValue();
+ String PK_COLUMN_VALUE_PROPERTY = "pkColummValue"; //$NON-NLS-1$
String getSpecifiedPkColumnValue();
void setSpecifiedPkColumnValue(String value);
String SPECIFIED_PK_COLUMN_VALUE_PROPERTY = "specifiedPkColummValue"; //$NON-NLS-1$
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 c42365d2b2..2f91bfe8d9 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
@@ -19,6 +19,7 @@ import org.eclipse.jpt.common.utility.transformer.Transformer;
import org.eclipse.jpt.jpa.core.context.DeleteTypeRefactoringParticipant;
import org.eclipse.jpt.jpa.core.context.Generator;
import org.eclipse.jpt.jpa.core.context.MappingFile;
+import org.eclipse.jpt.jpa.core.context.ModifiableSpecifiedSchemaReference;
import org.eclipse.jpt.jpa.core.context.PersistentType;
import org.eclipse.jpt.jpa.core.context.Query;
import org.eclipse.jpt.jpa.core.context.SpecifiedAccessReference;
@@ -50,6 +51,7 @@ public interface EntityMappings
XmlFile.Root,
PersistentType.Parent,
SpecifiedAccessReference,
+ ModifiableSpecifiedSchemaReference,
DeleteTypeRefactoringParticipant,
TypeRefactoringParticipant
{
@@ -93,22 +95,10 @@ 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();
- String DEFAULT_CATALOG_PROPERTY = "defaultCatalog"; //$NON-NLS-1$
- 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();
- String DEFAULT_SCHEMA_PROPERTY = "defaultSchema"; //$NON-NLS-1$
Schema getDbSchema();
+ Catalog getDbCatalog();
+
/**
* Covariant override.
*/
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 225d8f8106..8bfe8b79dc 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
@@ -9,8 +9,9 @@
******************************************************************************/
package org.eclipse.jpt.jpa.core.context.orm;
-import org.eclipse.jpt.jpa.core.context.SpecifiedAccessReference;
import org.eclipse.jpt.jpa.core.context.MappingFilePersistenceUnitDefaults;
+import org.eclipse.jpt.jpa.core.context.ModifiableSpecifiedSchemaReference;
+import org.eclipse.jpt.jpa.core.context.SpecifiedAccessReference;
import org.eclipse.jpt.jpa.db.Catalog;
import org.eclipse.jpt.jpa.db.Schema;
import org.eclipse.jpt.jpa.db.SchemaContainer;
@@ -31,35 +32,18 @@ import org.eclipse.jpt.jpa.db.SchemaContainer;
* @since 2.1
*/
public interface OrmPersistenceUnitDefaults
- extends MappingFilePersistenceUnitDefaults, SpecifiedAccessReference
+ extends MappingFilePersistenceUnitDefaults, SpecifiedAccessReference, ModifiableSpecifiedSchemaReference
{
/**
* Covariant override.
*/
OrmPersistenceUnitMetadata getParent();
- // ********** schema container **********
SchemaContainer getDbSchemaContainer();
- // ********** catalog **********
- String getSpecifiedCatalog();
- String CATALOG_PROPERTY = "catalog"; //$NON-NLS-1$
- void setSpecifiedCatalog(String newSpecifiedCatalog);
- String SPECIFIED_CATALOG_PROPERTY = "specifiedCatalog"; //$NON-NLS-1$
- String getDefaultCatalog();
- String DEFAULT_CATALOG_PROPERTY = "defaultCatalog"; //$NON-NLS-1$
Catalog getDbCatalog();
- // ********** schema **********
- String getSpecifiedSchema();
- String SCHEMA_PROPERTY = "schema"; //$NON-NLS-1$
- void setSpecifiedSchema(String newSpecifiedSchema);
- String SPECIFIED_SCHEMA_PROPERTY = "specifiedSchema"; //$NON-NLS-1$
- String getDefaultSchema();
- String DEFAULT_SCHEMA_PROPERTY = "defaultSchema"; //$NON-NLS-1$
Schema getDbSchema();
- // ********** cascade persist **********
void setCascadePersist(boolean value);
- String CASCADE_PERSIST_PROPERTY = "cascadePersist"; //$NON-NLS-1$
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaTable.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaTable.java
index 3a7d01b19f..1566acd9ca 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaTable.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaTable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2015 Oracle. All rights reserved.
+ * Copyright (c) 2007, 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.
@@ -54,12 +54,15 @@ public abstract class AbstractJavaTable<P extends JpaContextModel, PA extends Ta
protected String specifiedName;
protected String defaultName;
+ protected String name;
protected String specifiedSchema;
protected String defaultSchema;
+ protected String schema;
protected String specifiedCatalog;
protected String defaultCatalog;
+ protected String catalog;
protected final ContextListContainer<JavaSpecifiedUniqueConstraint, UniqueConstraintAnnotation> uniqueConstraintContainer;
@@ -93,9 +96,16 @@ public abstract class AbstractJavaTable<P extends JpaContextModel, PA extends Ta
@Override
public void update(IProgressMonitor monitor) {
super.update(monitor);
+
this.setDefaultName(this.buildDefaultName());
+ this.setName(this.buildName());
+
this.setDefaultSchema(this.buildDefaultSchema());
+ this.setSchema(this.buildSchema());
+
this.setDefaultCatalog(this.buildDefaultCatalog());
+ this.setCatalog(this.buildCatalog());
+
this.updateModels(this.getUniqueConstraints(), monitor);
}
@@ -134,6 +144,15 @@ public abstract class AbstractJavaTable<P extends JpaContextModel, PA extends Ta
// ********** name **********
public String getName() {
+ return this.name;
+ }
+
+ protected void setName(String name) {
+ String old = this.name;
+ this.firePropertyChanged(NAME_PROPERTY, old, this.name = name);
+ }
+
+ protected String buildName() {
return (this.specifiedName != null) ? this.specifiedName : this.defaultName;
}
@@ -151,8 +170,7 @@ public abstract class AbstractJavaTable<P extends JpaContextModel, PA extends Ta
protected void setSpecifiedName_(String name) {
String old = this.specifiedName;
- this.specifiedName = name;
- this.firePropertyChanged(SPECIFIED_NAME_PROPERTY, old, name);
+ this.firePropertyChanged(SPECIFIED_NAME_PROPERTY, old, this.specifiedName = name);
}
protected String buildSpecifiedName() {
@@ -165,8 +183,7 @@ public abstract class AbstractJavaTable<P extends JpaContextModel, PA extends Ta
protected void setDefaultName(String name) {
String old = this.defaultName;
- this.defaultName = name;
- this.firePropertyChanged(DEFAULT_NAME_PROPERTY, old, name);
+ this.firePropertyChanged(DEFAULT_NAME_PROPERTY, old, this.defaultName = name);
}
protected abstract String buildDefaultName();
@@ -175,6 +192,15 @@ public abstract class AbstractJavaTable<P extends JpaContextModel, PA extends Ta
// ********** 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;
}
@@ -192,8 +218,7 @@ public abstract class AbstractJavaTable<P extends JpaContextModel, PA extends Ta
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() {
@@ -206,8 +231,7 @@ public abstract class AbstractJavaTable<P extends JpaContextModel, PA extends Ta
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 abstract String buildDefaultSchema();
@@ -216,6 +240,15 @@ public abstract class AbstractJavaTable<P extends JpaContextModel, PA extends Ta
// ********** 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;
}
@@ -233,8 +266,7 @@ public abstract class AbstractJavaTable<P extends JpaContextModel, PA extends Ta
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() {
@@ -247,8 +279,7 @@ public abstract class AbstractJavaTable<P extends JpaContextModel, PA extends Ta
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 abstract String buildDefaultCatalog();
@@ -342,8 +373,8 @@ public abstract class AbstractJavaTable<P extends JpaContextModel, PA extends Ta
* 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();
}
/**
@@ -351,8 +382,8 @@ public abstract class AbstractJavaTable<P extends JpaContextModel, PA extends Ta
* 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);
}
public boolean isResolved() {
@@ -368,8 +399,8 @@ public abstract class AbstractJavaTable<P extends JpaContextModel, PA extends Ta
* catalog), then the database probably does not support catalogs.
*/
public boolean catalogIsResolved() {
- String catalog = this.getCatalog();
- return (catalog == null) || (this.resolveDbCatalog(catalog) != null);
+ String catalogString = this.getCatalog();
+ return (catalogString == null) || (this.resolveDbCatalog(catalogString) != null);
}
@@ -425,7 +456,7 @@ public abstract class AbstractJavaTable<P extends JpaContextModel, PA extends Ta
}
protected Iterable<String> getJavaCandidateNames() {
- return new TransformationIterable<String, String>(this.getCandidateNames(),
+ return new TransformationIterable<>(this.getCandidateNames(),
StringTools.JAVA_STRING_LITERAL_CONTENT_TRANSFORMER);
}
@@ -439,7 +470,7 @@ public abstract class AbstractJavaTable<P extends JpaContextModel, PA extends Ta
}
protected Iterable<String> getJavaCandidateSchemata() {
- return new TransformationIterable<String, String>(this.getCandidateSchemata(),
+ return new TransformationIterable<>(this.getCandidateSchemata(),
StringTools.JAVA_STRING_LITERAL_CONTENT_TRANSFORMER);
}
@@ -452,7 +483,7 @@ public abstract class AbstractJavaTable<P extends JpaContextModel, PA extends Ta
}
protected Iterable<String> getJavaCandidateCatalogs() {
- return new TransformationIterable<String, String>(this.getCandidateCatalogs(),
+ return new TransformationIterable<>(this.getCandidateCatalogs(),
StringTools.JAVA_STRING_LITERAL_CONTENT_TRANSFORMER);
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaVirtualTable.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaVirtualTable.java
index 7cbe18e249..269746a319 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaVirtualTable.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaVirtualTable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2015 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.
@@ -37,12 +37,15 @@ public abstract class AbstractJavaVirtualTable<P extends JpaContextModel, PA ext
protected String specifiedName;
protected String defaultName;
+ protected String name;
protected String specifiedSchema;
protected String defaultSchema;
+ protected String schema;
protected String specifiedCatalog;
protected String defaultCatalog;
+ protected String catalog;
protected final ContextListContainer<VirtualUniqueConstraint, UniqueConstraint> uniqueConstraintContainer;
@@ -63,12 +66,15 @@ public abstract class AbstractJavaVirtualTable<P extends JpaContextModel, PA ext
this.setSpecifiedName(this.buildSpecifiedName());
this.setDefaultName(this.buildDefaultName());
+ this.setName(this.buildName());
this.setSpecifiedSchema(this.buildSpecifiedSchema());
this.setDefaultSchema(this.buildDefaultSchema());
+ this.setSchema(this.buildSchema());
this.setSpecifiedCatalog(this.buildSpecifiedCatalog());
this.setDefaultCatalog(this.buildDefaultCatalog());
+ this.setCatalog(this.buildCatalog());
this.updateUniqueConstraints(monitor);
}
@@ -87,6 +93,15 @@ public abstract class AbstractJavaVirtualTable<P extends JpaContextModel, PA ext
// ********** name **********
public String getName() {
+ return this.name;
+ }
+
+ protected void setName(String name) {
+ String old = this.name;
+ this.firePropertyChanged(NAME_PROPERTY, old, this.name = name);
+ }
+
+ protected String buildName() {
return (this.specifiedName != null) ? this.specifiedName : this.defaultName;
}
@@ -96,8 +111,7 @@ public abstract class AbstractJavaVirtualTable<P extends JpaContextModel, PA ext
protected void setSpecifiedName(String name) {
String old = this.specifiedName;
- this.specifiedName = name;
- this.firePropertyChanged(SPECIFIED_NAME_PROPERTY, old, name);
+ this.firePropertyChanged(SPECIFIED_NAME_PROPERTY, old, this.specifiedName = name);
}
protected String buildSpecifiedName() {
@@ -110,8 +124,7 @@ public abstract class AbstractJavaVirtualTable<P extends JpaContextModel, PA ext
protected void setDefaultName(String name) {
String old = this.defaultName;
- this.defaultName = name;
- this.firePropertyChanged(DEFAULT_NAME_PROPERTY, old, name);
+ this.firePropertyChanged(DEFAULT_NAME_PROPERTY, old, this.defaultName = name);
}
protected abstract String buildDefaultName();
@@ -120,6 +133,15 @@ public abstract class AbstractJavaVirtualTable<P extends JpaContextModel, PA ext
// ********** 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;
}
@@ -129,8 +151,7 @@ public abstract class AbstractJavaVirtualTable<P extends JpaContextModel, PA ext
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() {
@@ -143,8 +164,7 @@ public abstract class AbstractJavaVirtualTable<P extends JpaContextModel, PA ext
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 abstract String buildDefaultSchema();
@@ -153,6 +173,15 @@ public abstract class AbstractJavaVirtualTable<P extends JpaContextModel, PA ext
// ********** 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;
}
@@ -162,8 +191,7 @@ public abstract class AbstractJavaVirtualTable<P extends JpaContextModel, PA ext
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() {
@@ -176,8 +204,7 @@ public abstract class AbstractJavaVirtualTable<P extends JpaContextModel, PA ext
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 abstract String buildDefaultCatalog();
@@ -202,7 +229,7 @@ public abstract class AbstractJavaVirtualTable<P extends JpaContextModel, PA ext
}
protected ListIterable<UniqueConstraint> getOverriddenUniqueConstraints() {
- return new SuperListIterableWrapper<UniqueConstraint>(this.getOverriddenTable().getUniqueConstraints());
+ return new SuperListIterableWrapper<>(this.getOverriddenTable().getUniqueConstraints());
}
protected void moveUniqueConstraint(int index, VirtualUniqueConstraint constraint) {
@@ -264,8 +291,8 @@ public abstract class AbstractJavaVirtualTable<P extends JpaContextModel, PA ext
* catalog), then the database probably does not support catalogs.
*/
public boolean catalogIsResolved() {
- String catalog = this.getCatalog();
- return (catalog == null) || (this.resolveDbCatalog(catalog) != null);
+ String string = this.getCatalog();
+ return (string == null) || (this.resolveDbCatalog(string) != null);
}
/**
@@ -274,8 +301,8 @@ public abstract class AbstractJavaVirtualTable<P extends JpaContextModel, PA ext
* get the schema directly from the database.
*/
public SchemaContainer getDbSchemaContainer() {
- String catalog = this.getCatalog();
- return (catalog != null) ? this.resolveDbCatalog(catalog) : this.getDatabase();
+ String string = this.getCatalog();
+ return (string != null) ? this.resolveDbCatalog(string) : this.getDatabase();
}
/**
@@ -283,8 +310,8 @@ public abstract class AbstractJavaVirtualTable<P extends JpaContextModel, PA ext
* catalog), then the database probably does not support catalogs.
*/
public Catalog getDbCatalog() {
- String catalog = this.getCatalog();
- return (catalog == null) ? null : this.resolveDbCatalog(catalog);
+ String string = this.getCatalog();
+ return (string == null) ? null : this.resolveDbCatalog(string);
}
public boolean isResolved() {
@@ -300,8 +327,8 @@ public abstract class AbstractJavaVirtualTable<P extends JpaContextModel, PA ext
* catalog), then the database probably does not support catalogs.
*/
protected boolean hasResolvedCatalog() {
- String catalog = this.getCatalog();
- return (catalog == null) || (this.resolveDbCatalog(catalog) != null);
+ String string = this.getCatalog();
+ return (string == null) || (this.resolveDbCatalog(string) != null);
}
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 3ecda969ee..16ffb8ff93 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
@@ -108,14 +108,14 @@ public abstract class AbstractEntityMappings
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 String specifiedCatalog;
+ protected String defaultCatalog;
+ protected String catalog;
+
protected final OrmPersistenceUnitMetadata persistenceUnitMetadata;
protected final Vector<OrmManagedType> managedTypes = new Vector<>();
@@ -141,8 +141,8 @@ public abstract class AbstractEntityMappings
this.package_ = this.xmlEntityMappings.getPackage();
this.specifiedAccess = this.buildSpecifiedAccess();
- this.specifiedCatalog = this.xmlEntityMappings.getCatalog();
this.specifiedSchema = this.xmlEntityMappings.getSchema();
+ this.specifiedCatalog = this.xmlEntityMappings.getCatalog();
this.persistenceUnitMetadata = this.buildPersistenceUnitMetadata();
@@ -166,8 +166,8 @@ public abstract class AbstractEntityMappings
this.setPackage_(this.xmlEntityMappings.getPackage());
this.setSpecifiedAccess_(this.buildSpecifiedAccess());
- this.setSpecifiedCatalog_(this.xmlEntityMappings.getCatalog());
this.setSpecifiedSchema_(this.xmlEntityMappings.getSchema());
+ this.setSpecifiedCatalog_(this.xmlEntityMappings.getCatalog());
this.persistenceUnitMetadata.synchronizeWithResourceModel(monitor);
@@ -186,12 +186,12 @@ public abstract class AbstractEntityMappings
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.setDefaultCatalog(this.buildDefaultCatalog());
+ this.setCatalog(this.buildCatalog());
+
this.persistenceUnitMetadata.update(monitor);
this.updateModels(this.getManagedTypes(), monitor);
@@ -428,6 +428,54 @@ public abstract class AbstractEntityMappings
}
+ // ********** 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;
+ }
+
+ public String getSpecifiedSchema() {
+ return this.specifiedSchema;
+ }
+
+ public void setSpecifiedSchema(String schema) {
+ this.setSpecifiedSchema_(schema);
+ this.xmlEntityMappings.setSchema(schema);
+ }
+
+ protected void setSpecifiedSchema_(String schema) {
+ String old = this.specifiedSchema;
+ this.firePropertyChanged(SPECIFIED_SCHEMA_PROPERTY, old, this.specifiedSchema = schema);
+ }
+
+ public String getDefaultSchema() {
+ return this.defaultSchema;
+ }
+
+ protected void setDefaultSchema(String schema) {
+ String old = this.defaultSchema;
+ this.firePropertyChanged(DEFAULT_SCHEMA_PROPERTY, old, this.defaultSchema = schema);
+ }
+
+ protected String buildDefaultSchema() {
+ return this.getPersistenceUnit().getDefaultSchema();
+ }
+
+ public Schema getDbSchema() {
+ SchemaContainer dbSchemaContainer = this.getDbSchemaContainer();
+ return (dbSchemaContainer == null) ? null : dbSchemaContainer.getSchemaForIdentifier(this.getSchema());
+ }
+
+
// ********** catalog **********
public String getCatalog() {
@@ -480,54 +528,6 @@ public abstract class AbstractEntityMappings
}
- // ********** 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;
- }
-
- public String getSpecifiedSchema() {
- return this.specifiedSchema;
- }
-
- public void setSpecifiedSchema(String schema) {
- this.setSpecifiedSchema_(schema);
- this.xmlEntityMappings.setSchema(schema);
- }
-
- protected void setSpecifiedSchema_(String schema) {
- String old = this.specifiedSchema;
- this.firePropertyChanged(SPECIFIED_SCHEMA_PROPERTY, old, this.specifiedSchema = schema);
- }
-
- public String getDefaultSchema() {
- return this.defaultSchema;
- }
-
- protected void setDefaultSchema(String schema) {
- String old = this.defaultSchema;
- this.firePropertyChanged(DEFAULT_SCHEMA_PROPERTY, old, this.defaultSchema = schema);
- }
-
- protected String buildDefaultSchema() {
- return this.getPersistenceUnit().getDefaultSchema();
- }
-
- public Schema getDbSchema() {
- SchemaContainer dbSchemaContainer = this.getDbSchemaContainer();
- return (dbSchemaContainer == null) ? null : dbSchemaContainer.getSchemaForIdentifier(this.getSchema());
- }
-
-
// ********** schema container **********
/**
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmTable.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmTable.java
index 38c478c1bb..0afcfda0ed 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmTable.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmTable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2015 Oracle. All rights reserved.
+ * Copyright (c) 2007, 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.
@@ -55,12 +55,15 @@ public abstract class AbstractOrmTable<P extends JpaContextModel, PA extends Tab
protected String specifiedName;
protected String defaultName;
+ protected String name;
protected String specifiedSchema;
protected String defaultSchema;
+ protected String schema;
protected String specifiedCatalog;
protected String defaultCatalog;
+ protected String catalog;
protected final ContextListContainer<OrmSpecifiedUniqueConstraint, XmlUniqueConstraint> uniqueConstraintContainer;
@@ -96,9 +99,16 @@ public abstract class AbstractOrmTable<P extends JpaContextModel, PA extends Tab
@Override
public void update(IProgressMonitor monitor) {
super.update(monitor);
+
this.setDefaultName(this.buildDefaultName());
+ this.setName(this.buildName());
+
this.setDefaultSchema(this.buildDefaultSchema());
+ this.setSchema(this.buildSchema());
+
this.setDefaultCatalog(this.buildDefaultCatalog());
+ this.setCatalog(this.buildCatalog());
+
this.updateModels(this.getUniqueConstraints(), monitor);
}
@@ -145,6 +155,15 @@ public abstract class AbstractOrmTable<P extends JpaContextModel, PA extends Tab
// ********** name **********
public String getName() {
+ return this.name;
+ }
+
+ protected void setName(String name) {
+ String old = this.name;
+ this.firePropertyChanged(NAME_PROPERTY, old, this.name = name);
+ }
+
+ protected String buildName() {
return (this.specifiedName != null) ? this.specifiedName : this.defaultName;
}
@@ -163,8 +182,7 @@ public abstract class AbstractOrmTable<P extends JpaContextModel, PA extends Tab
protected void setSpecifiedName_(String name) {
String old = this.specifiedName;
- this.specifiedName = name;
- this.firePropertyChanged(SPECIFIED_NAME_PROPERTY, old, name);
+ this.firePropertyChanged(SPECIFIED_NAME_PROPERTY, old, this.specifiedName = name);
}
protected String buildSpecifiedName() {
@@ -178,8 +196,7 @@ public abstract class AbstractOrmTable<P extends JpaContextModel, PA extends Tab
protected void setDefaultName(String name) {
String old = this.defaultName;
- this.defaultName = name;
- this.firePropertyChanged(DEFAULT_NAME_PROPERTY, old, name);
+ this.firePropertyChanged(DEFAULT_NAME_PROPERTY, old, this.defaultName = name);
}
protected abstract String buildDefaultName();
@@ -188,6 +205,15 @@ public abstract class AbstractOrmTable<P extends JpaContextModel, PA extends Tab
// ********** 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;
}
@@ -206,8 +232,7 @@ public abstract class AbstractOrmTable<P extends JpaContextModel, PA extends Tab
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() {
@@ -221,8 +246,7 @@ public abstract class AbstractOrmTable<P extends JpaContextModel, PA extends Tab
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 abstract String buildDefaultSchema();
@@ -231,6 +255,15 @@ public abstract class AbstractOrmTable<P extends JpaContextModel, PA extends Tab
// ********** 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;
}
@@ -249,8 +282,7 @@ public abstract class AbstractOrmTable<P extends JpaContextModel, PA extends Tab
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() {
@@ -264,8 +296,7 @@ public abstract class AbstractOrmTable<P extends JpaContextModel, PA extends Tab
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 abstract String buildDefaultCatalog();
@@ -371,8 +402,8 @@ public abstract class AbstractOrmTable<P extends JpaContextModel, PA extends Tab
* get the schema directly from the database.
*/
public SchemaContainer getDbSchemaContainer() {
- String catalog = this.getCatalog();
- return (catalog != null) ? this.resolveDbCatalog(catalog) : this.getDatabase();
+ String string = this.getCatalog();
+ return (string != null) ? this.resolveDbCatalog(string) : this.getDatabase();
}
/**
@@ -380,8 +411,8 @@ public abstract class AbstractOrmTable<P extends JpaContextModel, PA extends Tab
* catalog), then the database probably does not support catalogs.
*/
public Catalog getDbCatalog() {
- String catalog = this.getCatalog();
- return (catalog == null) ? null : this.resolveDbCatalog(catalog);
+ String string = this.getCatalog();
+ return (string == null) ? null : this.resolveDbCatalog(string);
}
public boolean isResolved() {
@@ -397,8 +428,8 @@ public abstract class AbstractOrmTable<P extends JpaContextModel, PA extends Tab
* catalog), then the database probably does not support catalogs.
*/
public boolean catalogIsResolved() {
- String catalog = this.getCatalog();
- return (catalog == null) || (this.resolveDbCatalog(catalog) != null);
+ String string = this.getCatalog();
+ return (string == null) || (this.resolveDbCatalog(string) != null);
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmVirtualTable.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmVirtualTable.java
index 23d4e39e22..aa12ddcb18 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmVirtualTable.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmVirtualTable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2015 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.
@@ -37,12 +37,15 @@ public abstract class AbstractOrmVirtualTable<P extends JpaContextModel, PA exte
protected String specifiedName;
protected String defaultName;
+ protected String name;
protected String specifiedSchema;
protected String defaultSchema;
+ protected String schema;
protected String specifiedCatalog;
protected String defaultCatalog;
+ protected String catalog;
protected final ContextListContainer<VirtualUniqueConstraint, UniqueConstraint> uniqueConstraintContainer;
@@ -63,12 +66,15 @@ public abstract class AbstractOrmVirtualTable<P extends JpaContextModel, PA exte
this.setSpecifiedName(this.buildSpecifiedName());
this.setDefaultName(this.buildDefaultName());
+ this.setName(this.buildName());
this.setSpecifiedSchema(this.buildSpecifiedSchema());
this.setDefaultSchema(this.buildDefaultSchema());
+ this.setSchema(this.buildSchema());
this.setSpecifiedCatalog(this.buildSpecifiedCatalog());
this.setDefaultCatalog(this.buildDefaultCatalog());
+ this.setCatalog(this.buildCatalog());
this.updateUniqueConstraints(monitor);
}
@@ -87,6 +93,15 @@ public abstract class AbstractOrmVirtualTable<P extends JpaContextModel, PA exte
// ********** name **********
public String getName() {
+ return this.name;
+ }
+
+ protected void setName(String name) {
+ String old = this.name;
+ this.firePropertyChanged(NAME_PROPERTY, old, this.name = name);
+ }
+
+ protected String buildName() {
return (this.specifiedName != null) ? this.specifiedName : this.defaultName;
}
@@ -96,8 +111,7 @@ public abstract class AbstractOrmVirtualTable<P extends JpaContextModel, PA exte
protected void setSpecifiedName(String name) {
String old = this.specifiedName;
- this.specifiedName = name;
- this.firePropertyChanged(SPECIFIED_NAME_PROPERTY, old, name);
+ this.firePropertyChanged(SPECIFIED_NAME_PROPERTY, old, this.specifiedName = name);
}
protected String buildSpecifiedName() {
@@ -110,8 +124,7 @@ public abstract class AbstractOrmVirtualTable<P extends JpaContextModel, PA exte
protected void setDefaultName(String name) {
String old = this.defaultName;
- this.defaultName = name;
- this.firePropertyChanged(DEFAULT_NAME_PROPERTY, old, name);
+ this.firePropertyChanged(DEFAULT_NAME_PROPERTY, old, this.defaultName = name);
}
protected abstract String buildDefaultName();
@@ -120,6 +133,15 @@ public abstract class AbstractOrmVirtualTable<P extends JpaContextModel, PA exte
// ********** 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;
}
@@ -129,8 +151,7 @@ public abstract class AbstractOrmVirtualTable<P extends JpaContextModel, PA exte
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() {
@@ -143,8 +164,7 @@ public abstract class AbstractOrmVirtualTable<P extends JpaContextModel, PA exte
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 abstract String buildDefaultSchema();
@@ -153,6 +173,15 @@ public abstract class AbstractOrmVirtualTable<P extends JpaContextModel, PA exte
// ********** 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;
}
@@ -162,8 +191,7 @@ public abstract class AbstractOrmVirtualTable<P extends JpaContextModel, PA exte
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() {
@@ -176,8 +204,7 @@ public abstract class AbstractOrmVirtualTable<P extends JpaContextModel, PA exte
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 abstract String buildDefaultCatalog();
@@ -202,7 +229,7 @@ public abstract class AbstractOrmVirtualTable<P extends JpaContextModel, PA exte
}
protected ListIterable<UniqueConstraint> getOverriddenUniqueConstraints() {
- return new SuperListIterableWrapper<UniqueConstraint>(this.getOverriddenTable().getUniqueConstraints());
+ return new SuperListIterableWrapper<>(this.getOverriddenTable().getUniqueConstraints());
}
protected void moveUniqueConstraint(int index, VirtualUniqueConstraint constraint) {
@@ -265,8 +292,8 @@ public abstract class AbstractOrmVirtualTable<P extends JpaContextModel, PA exte
* get the schema directly from the database.
*/
public SchemaContainer getDbSchemaContainer() {
- String catalog = this.getCatalog();
- return (catalog != null) ? this.resolveDbCatalog(catalog) : this.getDatabase();
+ String string = this.getCatalog();
+ return (string != null) ? this.resolveDbCatalog(string) : this.getDatabase();
}
/**
@@ -274,8 +301,8 @@ public abstract class AbstractOrmVirtualTable<P extends JpaContextModel, PA exte
* catalog), then the database probably does not support catalogs.
*/
public Catalog getDbCatalog() {
- String catalog = this.getCatalog();
- return (catalog == null) ? null : this.resolveDbCatalog(catalog);
+ String string = this.getCatalog();
+ return (string == null) ? null : this.resolveDbCatalog(string);
}
/**
@@ -283,8 +310,8 @@ public abstract class AbstractOrmVirtualTable<P extends JpaContextModel, PA exte
* catalog), then the database probably does not support catalogs.
*/
public boolean catalogIsResolved() {
- String catalog = this.getCatalog();
- return (catalog == null) || (this.resolveDbCatalog(catalog) != null);
+ String string = this.getCatalog();
+ return (string == null) || (this.resolveDbCatalog(string) != null);
}
public boolean isResolved() {
@@ -300,8 +327,8 @@ public abstract class AbstractOrmVirtualTable<P extends JpaContextModel, PA exte
* catalog), then the database probably does not support catalogs.
*/
protected boolean hasResolvedCatalog() {
- String catalog = this.getCatalog();
- return (catalog == null) || (this.resolveDbCatalog(catalog) != null);
+ String string = this.getCatalog();
+ return (string == null) || (this.resolveDbCatalog(string) != null);
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJavaTableGenerator.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJavaTableGenerator.java
index 11c6103eb4..0895805feb 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJavaTableGenerator.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJavaTableGenerator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2015 Oracle. All rights reserved.
+ * Copyright (c) 2007, 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,21 +43,27 @@ public class GenericJavaTableGenerator
{
protected String specifiedTableName;
protected String defaultTableName;
+ protected String tableName;
protected String specifiedSchema;
protected String defaultSchema;
+ protected String schema;
protected String specifiedCatalog;
protected String defaultCatalog;
+ protected String catalog;
protected String specifiedPkColumnName;
protected String defaultPkColumnName;
+ protected String pkColumnName;
protected String specifiedValueColumnName;
protected String defaultValueColumnName;
+ protected String valueColumnName;
protected String specifiedPkColumnValue;
protected String defaultPkColumnValue;
+ protected String pkColumnValue;
protected final ContextListContainer<JavaSpecifiedUniqueConstraint, UniqueConstraintAnnotation> uniqueConstraintContainer;
@@ -93,12 +99,25 @@ public class GenericJavaTableGenerator
@Override
public void update(IProgressMonitor monitor) {
super.update(monitor);
+
this.setDefaultTableName(this.buildDefaultTableName());
+ this.setTableName(this.buildTableName());
+
this.setDefaultSchema(this.buildDefaultSchema());
+ this.setSchema(this.buildSchema());
+
this.setDefaultCatalog(this.buildDefaultCatalog());
+ this.setCatalog(this.buildCatalog());
+
this.setDefaultPkColumnName(this.buildDefaultPkColumnName());
+ this.setPkColumnName(this.buildPkColumnName());
+
this.setDefaultValueColumnName(this.buildDefaultValueColumnName());
+ this.setValueColumnName(this.buildValueColumnName());
+
this.setDefaultPkColumnValue(this.buildDefaultPkColumnValue());
+ this.setPkColumnValue(this.buildPkColumnValue());
+
this.updateModels(this.getUniqueConstraints(), monitor);
}
@@ -114,6 +133,15 @@ public class GenericJavaTableGenerator
// ********** table name **********
public String getTableName() {
+ return this.tableName;
+ }
+
+ protected void setTableName(String tableName) {
+ String old = this.tableName;
+ this.firePropertyChanged(TABLE_NAME_PROPERTY, old, this.tableName = tableName);
+ }
+
+ protected String buildTableName() {
return (this.specifiedTableName != null) ? this.specifiedTableName : this.defaultTableName;
}
@@ -128,8 +156,7 @@ public class GenericJavaTableGenerator
protected void setSpecifiedTableName_(String tableName) {
String old = this.specifiedTableName;
- this.specifiedTableName = tableName;
- this.firePropertyChanged(SPECIFIED_TABLE_NAME_PROPERTY, old, tableName);
+ this.firePropertyChanged(SPECIFIED_TABLE_NAME_PROPERTY, old, this.specifiedTableName = tableName);
}
public String getDefaultTableName() {
@@ -138,8 +165,7 @@ public class GenericJavaTableGenerator
protected void setDefaultTableName(String tableName) {
String old = this.defaultTableName;
- this.defaultTableName = tableName;
- this.firePropertyChanged(DEFAULT_TABLE_NAME_PROPERTY, old, tableName);
+ this.firePropertyChanged(DEFAULT_TABLE_NAME_PROPERTY, old, this.defaultTableName = tableName);
}
protected String buildDefaultTableName() {
@@ -156,6 +182,15 @@ public class GenericJavaTableGenerator
@Override
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;
}
@@ -170,8 +205,7 @@ public class GenericJavaTableGenerator
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() {
@@ -180,8 +214,7 @@ public class GenericJavaTableGenerator
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() {
@@ -193,6 +226,15 @@ public class GenericJavaTableGenerator
@Override
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;
}
@@ -207,8 +249,7 @@ public class GenericJavaTableGenerator
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() {
@@ -217,8 +258,7 @@ public class GenericJavaTableGenerator
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() {
@@ -229,6 +269,15 @@ public class GenericJavaTableGenerator
// ********** primary key column name **********
public String getPkColumnName() {
+ return this.pkColumnName;
+ }
+
+ protected void setPkColumnName(String name) {
+ String old = this.pkColumnName;
+ this.firePropertyChanged(PK_COLUMN_NAME_PROPERTY, old, this.pkColumnName = name);
+ }
+
+ protected String buildPkColumnName() {
return (this.specifiedPkColumnName != null) ? this.specifiedPkColumnName : this.defaultPkColumnName;
}
@@ -243,8 +292,7 @@ public class GenericJavaTableGenerator
protected void setSpecifiedPkColumnName_(String name) {
String old = this.specifiedPkColumnName;
- this.specifiedPkColumnName = name;
- this.firePropertyChanged(SPECIFIED_PK_COLUMN_NAME_PROPERTY, old, name);
+ this.firePropertyChanged(SPECIFIED_PK_COLUMN_NAME_PROPERTY, old, this.specifiedPkColumnName = name);
}
public String getDefaultPkColumnName() {
@@ -253,8 +301,7 @@ public class GenericJavaTableGenerator
protected void setDefaultPkColumnName(String name) {
String old = this.defaultPkColumnName;
- this.defaultPkColumnName = name;
- this.firePropertyChanged(DEFAULT_PK_COLUMN_NAME_PROPERTY, old, name);
+ this.firePropertyChanged(DEFAULT_PK_COLUMN_NAME_PROPERTY, old, this.defaultPkColumnName = name);
}
protected String buildDefaultPkColumnName() {
@@ -265,6 +312,15 @@ public class GenericJavaTableGenerator
// ********** value column name **********
public String getValueColumnName() {
+ return this.valueColumnName;
+ }
+
+ protected void setValueColumnName(String name) {
+ String old = this.valueColumnName;
+ this.firePropertyChanged(VALUE_COLUMN_NAME_PROPERTY, old, this.valueColumnName = name);
+ }
+
+ protected String buildValueColumnName() {
return (this.specifiedValueColumnName != null) ? this.specifiedValueColumnName : this.defaultValueColumnName;
}
@@ -279,8 +335,7 @@ public class GenericJavaTableGenerator
protected void setSpecifiedValueColumnName_(String name) {
String old = this.specifiedValueColumnName;
- this.specifiedValueColumnName = name;
- this.firePropertyChanged(SPECIFIED_VALUE_COLUMN_NAME_PROPERTY, old, name);
+ this.firePropertyChanged(SPECIFIED_VALUE_COLUMN_NAME_PROPERTY, old, this.specifiedValueColumnName = name);
}
public String getDefaultValueColumnName() {
@@ -289,8 +344,7 @@ public class GenericJavaTableGenerator
protected void setDefaultValueColumnName(String name) {
String old = this.defaultValueColumnName;
- this.defaultValueColumnName = name;
- this.firePropertyChanged(DEFAULT_VALUE_COLUMN_NAME_PROPERTY, old, name);
+ this.firePropertyChanged(DEFAULT_VALUE_COLUMN_NAME_PROPERTY, old, this.defaultValueColumnName = name);
}
protected String buildDefaultValueColumnName() {
@@ -301,6 +355,15 @@ public class GenericJavaTableGenerator
// ********** primary key column value **********
public String getPkColumnValue() {
+ return this.pkColumnValue;
+ }
+
+ protected void setPkColumnValue(String value) {
+ String old = this.pkColumnValue;
+ this.firePropertyChanged(PK_COLUMN_VALUE_PROPERTY, old, this.pkColumnValue = value);
+ }
+
+ protected String buildPkColumnValue() {
return (this.specifiedPkColumnValue != null) ? this.specifiedPkColumnValue : this.defaultPkColumnValue;
}
@@ -315,8 +378,7 @@ public class GenericJavaTableGenerator
protected void setSpecifiedPkColumnValue_(String value) {
String old = this.specifiedPkColumnValue;
- this.specifiedPkColumnValue = value;
- this.firePropertyChanged(SPECIFIED_PK_COLUMN_VALUE_PROPERTY, old, value);
+ this.firePropertyChanged(SPECIFIED_PK_COLUMN_VALUE_PROPERTY, old, this.specifiedPkColumnValue = value);
}
public String getDefaultPkColumnValue() {
@@ -325,8 +387,7 @@ public class GenericJavaTableGenerator
protected void setDefaultPkColumnValue(String value) {
String old = this.defaultPkColumnValue;
- this.defaultPkColumnValue = value;
- this.firePropertyChanged(DEFAULT_PK_COLUMN_VALUE_PROPERTY, old, value);
+ this.firePropertyChanged(DEFAULT_PK_COLUMN_VALUE_PROPERTY, old, this.defaultPkColumnValue = value);
}
protected String buildDefaultPkColumnValue() {
@@ -465,7 +526,7 @@ public class GenericJavaTableGenerator
}
protected Iterable<String> getJavaCandidateTables() {
- return new TransformationIterable<String, String>(this.getCandidateTables(),
+ return new TransformationIterable<>(this.getCandidateTables(),
StringTools.JAVA_STRING_LITERAL_CONTENT_TRANSFORMER);
}
@@ -481,7 +542,7 @@ public class GenericJavaTableGenerator
}
protected Iterable<String> getJavaCandidateSchemata() {
- return new TransformationIterable<String, String>(this.getCandidateSchemata(),
+ return new TransformationIterable<>(this.getCandidateSchemata(),
StringTools.JAVA_STRING_LITERAL_CONTENT_TRANSFORMER);
}
@@ -497,7 +558,7 @@ public class GenericJavaTableGenerator
}
protected Iterable<String> getJavaCandidateCatalogs(Predicate<String> filter) {
- return new TransformationIterable<String, String>(this.getCandidateCatalogs(filter),
+ return new TransformationIterable<>(this.getCandidateCatalogs(filter),
StringTools.JAVA_STRING_LITERAL_CONTENT_TRANSFORMER);
}
@@ -517,7 +578,7 @@ public class GenericJavaTableGenerator
}
protected Iterable<String> getJavaCandidateColumnNames() {
- return new TransformationIterable<String, String>(this.getCandidateColumnNames(),
+ return new TransformationIterable<>(this.getCandidateColumnNames(),
StringTools.JAVA_STRING_LITERAL_CONTENT_TRANSFORMER);
}
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 8c9a483087..f9301eaf09 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
@@ -36,14 +36,14 @@ public abstract class AbstractOrmPersistenceUnitDefaults
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 String specifiedCatalog;
+ protected String defaultCatalog;
+ protected String catalog;
+
protected boolean cascadePersist;
protected boolean delimitedIdentifiers;
@@ -54,14 +54,14 @@ public abstract class AbstractOrmPersistenceUnitDefaults
protected AbstractOrmPersistenceUnitDefaults(OrmPersistenceUnitMetadata parent) {
super(parent);
this.specifiedAccess = this.buildSpecifiedAccess();
- this.specifiedCatalog = this.buildSpecifiedCatalog();
this.specifiedSchema = this.buildSpecifiedSchema();
+ this.specifiedCatalog = this.buildSpecifiedCatalog();
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();
+ this.defaultCatalog = this.buildDefaultCatalog();
}
@@ -71,8 +71,8 @@ public abstract class AbstractOrmPersistenceUnitDefaults
public void synchronizeWithResourceModel(IProgressMonitor monitor) {
super.synchronizeWithResourceModel(monitor);
this.setSpecifiedAccess_(this.buildSpecifiedAccess());
- this.setSpecifiedCatalog_(this.buildSpecifiedCatalog());
this.setSpecifiedSchema_(this.buildSpecifiedSchema());
+ this.setSpecifiedCatalog_(this.buildSpecifiedCatalog());
this.setCascadePersist_(this.buildCascadePersist());
this.setDelimitedIdentifiers_(this.buildDelimitedIdentifiers());
}
@@ -83,11 +83,11 @@ public abstract class AbstractOrmPersistenceUnitDefaults
this.setAccess(this.buildAccess());
- this.setDefaultCatalog(this.buildDefaultCatalog());
- this.setCatalog(this.buildCatalog());
-
this.setDefaultSchema(this.buildDefaultSchema());
this.setSchema(this.buildSchema());
+
+ this.setDefaultCatalog(this.buildDefaultCatalog());
+ this.setCatalog(this.buildCatalog());
}
@@ -147,6 +147,63 @@ public abstract class AbstractOrmPersistenceUnitDefaults
}
+ // ********** 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;
+ }
+
+ public String getSpecifiedSchema() {
+ return this.specifiedSchema;
+ }
+
+ public void setSpecifiedSchema(String schema) {
+ if (ObjectTools.notEquals(this.specifiedSchema, schema)) {
+ XmlPersistenceUnitDefaults xmlDefaults = this.getXmlDefaultsForUpdate();
+ this.setSpecifiedSchema_(schema);
+ xmlDefaults.setSchema(schema);
+ this.removeXmlDefaultsIfUnset();
+ }
+ }
+
+ protected void setSpecifiedSchema_(String schema) {
+ String old = this.specifiedSchema;
+ this.firePropertyChanged(SPECIFIED_SCHEMA_PROPERTY, old, this.specifiedSchema = schema);
+ }
+
+ protected String buildSpecifiedSchema() {
+ XmlPersistenceUnitDefaults xmlDefaults = this.getXmlDefaults();
+ return (xmlDefaults == null) ? null : xmlDefaults.getSchema();
+ }
+
+ public String getDefaultSchema() {
+ return this.defaultSchema;
+ }
+
+ protected void setDefaultSchema(String schema) {
+ String old = this.defaultSchema;
+ this.firePropertyChanged(DEFAULT_SCHEMA_PROPERTY, old, this.defaultSchema = schema);
+ }
+
+ protected String buildDefaultSchema() {
+ return this.getJpaProject().getDefaultSchema();
+ }
+
+ public Schema getDbSchema() {
+ SchemaContainer dbSchemaContainer = this.getDbSchemaContainer();
+ return (dbSchemaContainer == null) ? null : dbSchemaContainer.getSchemaForIdentifier(this.getSchema());
+ }
+
+
// ********** catalog **********
public String getCatalog() {
@@ -208,63 +265,6 @@ public abstract class AbstractOrmPersistenceUnitDefaults
}
- // ********** 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;
- }
-
- public String getSpecifiedSchema() {
- return this.specifiedSchema;
- }
-
- public void setSpecifiedSchema(String schema) {
- if (ObjectTools.notEquals(this.specifiedSchema, schema)) {
- XmlPersistenceUnitDefaults xmlDefaults = this.getXmlDefaultsForUpdate();
- this.setSpecifiedSchema_(schema);
- xmlDefaults.setSchema(schema);
- this.removeXmlDefaultsIfUnset();
- }
- }
-
- protected void setSpecifiedSchema_(String schema) {
- String old = this.specifiedSchema;
- this.firePropertyChanged(SPECIFIED_SCHEMA_PROPERTY, old, this.specifiedSchema = schema);
- }
-
- protected String buildSpecifiedSchema() {
- XmlPersistenceUnitDefaults xmlDefaults = this.getXmlDefaults();
- return (xmlDefaults == null) ? null : xmlDefaults.getSchema();
- }
-
- public String getDefaultSchema() {
- return this.defaultSchema;
- }
-
- protected void setDefaultSchema(String schema) {
- String old = this.defaultSchema;
- this.firePropertyChanged(DEFAULT_SCHEMA_PROPERTY, old, this.defaultSchema = schema);
- }
-
- protected String buildDefaultSchema() {
- return this.getJpaProject().getDefaultSchema();
- }
-
- public Schema getDbSchema() {
- SchemaContainer dbSchemaContainer = this.getDbSchemaContainer();
- return (dbSchemaContainer == null) ? null : dbSchemaContainer.getSchemaForIdentifier(this.getSchema());
- }
-
-
// ********** cascade persist **********
public boolean isCascadePersist() {
@@ -282,8 +282,7 @@ public abstract class AbstractOrmPersistenceUnitDefaults
protected void setCascadePersist_(boolean cascadePersist) {
boolean old = this.cascadePersist;
- this.cascadePersist = cascadePersist;
- this.firePropertyChanged(CASCADE_PERSIST_PROPERTY, old, cascadePersist);
+ this.firePropertyChanged(CASCADE_PERSIST_PROPERTY, old, this.cascadePersist = cascadePersist);
}
protected boolean buildCascadePersist() {
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/GenericOrmTableGenerator.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/GenericOrmTableGenerator.java
index e292e688b0..54956091fe 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/GenericOrmTableGenerator.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/GenericOrmTableGenerator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2015 Oracle. All rights reserved.
+ * Copyright (c) 2007, 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.
@@ -40,21 +40,27 @@ public class GenericOrmTableGenerator
{
protected String specifiedTableName;
protected String defaultTableName;
+ protected String tableName;
protected String specifiedSchema;
protected String defaultSchema;
+ protected String schema;
protected String specifiedCatalog;
protected String defaultCatalog;
+ protected String catalog;
protected String specifiedPkColumnName;
protected String defaultPkColumnName;
+ protected String pkColumnName;
protected String specifiedValueColumnName;
protected String defaultValueColumnName;
+ protected String valueColumnName;
protected String specifiedPkColumnValue;
protected String defaultPkColumnValue;
+ protected String pkColumnValue;
protected final ContextListContainer<OrmSpecifiedUniqueConstraint, XmlUniqueConstraint> uniqueConstraintContainer;
@@ -90,12 +96,25 @@ public class GenericOrmTableGenerator
@Override
public void update(IProgressMonitor monitor) {
super.update(monitor);
+
this.setDefaultTableName(this.buildDefaultTableName());
+ this.setTableName(this.buildTableName());
+
this.setDefaultSchema(this.buildDefaultSchema());
+ this.setSchema(this.buildSchema());
+
this.setDefaultCatalog(this.buildDefaultCatalog());
+ this.setCatalog(this.buildCatalog());
+
this.setDefaultPkColumnName(this.buildDefaultPkColumnName());
+ this.setPkColumnName(this.buildPkColumnName());
+
this.setDefaultValueColumnName(this.buildDefaultValueColumnName());
+ this.setValueColumnName(this.buildValueColumnName());
+
this.setDefaultPkColumnValue(this.buildDefaultPkColumnValue());
+ this.setPkColumnValue(this.buildPkColumnValue());
+
this.updateModels(this.getUniqueConstraints(), monitor);
}
@@ -111,6 +130,15 @@ public class GenericOrmTableGenerator
// ********** table name **********
public String getTableName() {
+ return this.tableName;
+ }
+
+ protected void setTableName(String tableName) {
+ String old = this.tableName;
+ this.firePropertyChanged(TABLE_NAME_PROPERTY, old, this.tableName = tableName);
+ }
+
+ protected String buildTableName() {
return (this.specifiedTableName != null) ? this.specifiedTableName : this.defaultTableName;
}
@@ -125,8 +153,7 @@ public class GenericOrmTableGenerator
protected void setSpecifiedTableName_(String tableName) {
String old = this.specifiedTableName;
- this.specifiedTableName = tableName;
- this.firePropertyChanged(SPECIFIED_TABLE_NAME_PROPERTY, old, tableName);
+ this.firePropertyChanged(SPECIFIED_TABLE_NAME_PROPERTY, old, this.specifiedTableName = tableName);
}
public String getDefaultTableName() {
@@ -135,8 +162,7 @@ public class GenericOrmTableGenerator
protected void setDefaultTableName(String tableName) {
String old = this.defaultTableName;
- this.defaultTableName = tableName;
- this.firePropertyChanged(DEFAULT_TABLE_NAME_PROPERTY, old, tableName);
+ this.firePropertyChanged(DEFAULT_TABLE_NAME_PROPERTY, old, this.defaultTableName = tableName);
}
protected String buildDefaultTableName() {
@@ -153,6 +179,15 @@ public class GenericOrmTableGenerator
@Override
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;
}
@@ -167,8 +202,7 @@ public class GenericOrmTableGenerator
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() {
@@ -177,8 +211,7 @@ public class GenericOrmTableGenerator
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() {
@@ -190,6 +223,15 @@ public class GenericOrmTableGenerator
@Override
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;
}
@@ -204,8 +246,7 @@ public class GenericOrmTableGenerator
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() {
@@ -214,8 +255,7 @@ public class GenericOrmTableGenerator
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() {
@@ -226,6 +266,15 @@ public class GenericOrmTableGenerator
// ********** primary key column name **********
public String getPkColumnName() {
+ return this.pkColumnName;
+ }
+
+ protected void setPkColumnName(String name) {
+ String old = this.pkColumnName;
+ this.firePropertyChanged(PK_COLUMN_NAME_PROPERTY, old, this.pkColumnName = name);
+ }
+
+ protected String buildPkColumnName() {
return (this.specifiedPkColumnName != null) ? this.specifiedPkColumnName : this.defaultPkColumnName;
}
@@ -240,8 +289,7 @@ public class GenericOrmTableGenerator
protected void setSpecifiedPkColumnName_(String name) {
String old = this.specifiedPkColumnName;
- this.specifiedPkColumnName = name;
- this.firePropertyChanged(SPECIFIED_PK_COLUMN_NAME_PROPERTY, old, name);
+ this.firePropertyChanged(SPECIFIED_PK_COLUMN_NAME_PROPERTY, old, this.specifiedPkColumnName = name);
}
public String getDefaultPkColumnName() {
@@ -250,8 +298,7 @@ public class GenericOrmTableGenerator
protected void setDefaultPkColumnName(String name) {
String old = this.defaultPkColumnName;
- this.defaultPkColumnName = name;
- this.firePropertyChanged(DEFAULT_PK_COLUMN_NAME_PROPERTY, old, name);
+ this.firePropertyChanged(DEFAULT_PK_COLUMN_NAME_PROPERTY, old, this.defaultPkColumnName = name);
}
protected String buildDefaultPkColumnName() {
@@ -262,6 +309,15 @@ public class GenericOrmTableGenerator
// ********** value column name **********
public String getValueColumnName() {
+ return this.valueColumnName;
+ }
+
+ protected void setValueColumnName(String name) {
+ String old = this.valueColumnName;
+ this.firePropertyChanged(VALUE_COLUMN_NAME_PROPERTY, old, this.valueColumnName = name);
+ }
+
+ protected String buildValueColumnName() {
return (this.specifiedValueColumnName != null) ? this.specifiedValueColumnName : this.defaultValueColumnName;
}
@@ -276,8 +332,7 @@ public class GenericOrmTableGenerator
protected void setSpecifiedValueColumnName_(String name) {
String old = this.specifiedValueColumnName;
- this.specifiedValueColumnName = name;
- this.firePropertyChanged(SPECIFIED_VALUE_COLUMN_NAME_PROPERTY, old, name);
+ this.firePropertyChanged(SPECIFIED_VALUE_COLUMN_NAME_PROPERTY, old, this.specifiedValueColumnName = name);
}
public String getDefaultValueColumnName() {
@@ -286,8 +341,7 @@ public class GenericOrmTableGenerator
protected void setDefaultValueColumnName(String name) {
String old = this.defaultValueColumnName;
- this.defaultValueColumnName = name;
- this.firePropertyChanged(DEFAULT_VALUE_COLUMN_NAME_PROPERTY, old, name);
+ this.firePropertyChanged(DEFAULT_VALUE_COLUMN_NAME_PROPERTY, old, this.defaultValueColumnName = name);
}
protected String buildDefaultValueColumnName() {
@@ -298,6 +352,15 @@ public class GenericOrmTableGenerator
// ********** primary key column value **********
public String getPkColumnValue() {
+ return this.pkColumnValue;
+ }
+
+ protected void setPkColumnValue(String value) {
+ String old = this.pkColumnValue;
+ this.firePropertyChanged(PK_COLUMN_VALUE_PROPERTY, old, this.pkColumnValue = value);
+ }
+
+ protected String buildPkColumnValue() {
return (this.specifiedPkColumnValue != null) ? this.specifiedPkColumnValue : this.defaultPkColumnValue;
}
@@ -312,8 +375,7 @@ public class GenericOrmTableGenerator
protected void setSpecifiedPkColumnValue_(String value) {
String old = this.specifiedPkColumnValue;
- this.specifiedPkColumnValue = value;
- this.firePropertyChanged(SPECIFIED_PK_COLUMN_VALUE_PROPERTY, old, value);
+ this.firePropertyChanged(SPECIFIED_PK_COLUMN_VALUE_PROPERTY, old, this.specifiedPkColumnValue = value);
}
public String getDefaultPkColumnValue() {
@@ -322,8 +384,7 @@ public class GenericOrmTableGenerator
protected void setDefaultPkColumnValue(String value) {
String old = this.defaultPkColumnValue;
- this.defaultPkColumnValue = value;
- this.firePropertyChanged(DEFAULT_PK_COLUMN_VALUE_PROPERTY, old, value);
+ this.firePropertyChanged(DEFAULT_PK_COLUMN_VALUE_PROPERTY, old, this.defaultPkColumnValue = value);
}
protected String buildDefaultPkColumnValue() {
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/java/GenericJavaSequenceGenerator2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/java/GenericJavaSequenceGenerator2_0.java
index e47f4b7c4d..aab637ef3f 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/java/GenericJavaSequenceGenerator2_0.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/java/GenericJavaSequenceGenerator2_0.java
@@ -1,5 +1,5 @@
/*******************************************************************************
-* Copyright (c) 2009, 2015 Oracle. All rights reserved.
+* Copyright (c) 2009, 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.
@@ -26,17 +26,19 @@ public class GenericJavaSequenceGenerator2_0
extends AbstractJavaSequenceGenerator<SequenceGeneratorAnnotation2_0>
implements JavaSequenceGenerator2_0
{
- protected String specifiedCatalog;
- protected String defaultCatalog;
-
protected String specifiedSchema;
protected String defaultSchema;
+ protected String schema;
+
+ protected String specifiedCatalog;
+ protected String defaultCatalog;
+ protected String catalog;
public GenericJavaSequenceGenerator2_0(JavaGeneratorContainer parent, SequenceGeneratorAnnotation2_0 generatorAnnotation) {
super(parent, generatorAnnotation);
- this.specifiedCatalog = generatorAnnotation.getCatalog();
this.specifiedSchema = generatorAnnotation.getSchema();
+ this.specifiedCatalog = generatorAnnotation.getCatalog();
}
@@ -45,59 +47,35 @@ public class GenericJavaSequenceGenerator2_0
@Override
public void synchronizeWithResourceModel(IProgressMonitor monitor) {
super.synchronizeWithResourceModel(monitor);
- this.setSpecifiedCatalog_(this.generatorAnnotation.getCatalog());
this.setSpecifiedSchema_(this.generatorAnnotation.getSchema());
+ this.setSpecifiedCatalog_(this.generatorAnnotation.getCatalog());
}
@Override
public void update(IProgressMonitor monitor) {
super.update(monitor);
- this.setDefaultCatalog(this.buildDefaultCatalog());
- this.setDefaultSchema(this.buildDefaultSchema());
- }
-
- // ********** catalog **********
-
- @Override
- public String getCatalog() {
- return (this.specifiedCatalog != null) ? this.specifiedCatalog : this.defaultCatalog;
- }
-
- public String getSpecifiedCatalog() {
- return this.specifiedCatalog;
- }
+ this.setDefaultSchema(this.buildDefaultSchema());
+ this.setSchema(this.buildSchema());
- public void setSpecifiedCatalog(String catalog) {
- this.generatorAnnotation.setCatalog(catalog);
- this.setSpecifiedCatalog_(catalog);
+ this.setDefaultCatalog(this.buildDefaultCatalog());
+ this.setCatalog(this.buildCatalog());
}
- protected void setSpecifiedCatalog_(String catalog) {
- String old = this.specifiedCatalog;
- this.specifiedCatalog = catalog;
- this.firePropertyChanged(SPECIFIED_CATALOG_PROPERTY, old, catalog);
- }
- public String getDefaultCatalog() {
- return this.defaultCatalog;
- }
+ // ********** schema **********
- protected void setDefaultCatalog(String catalog) {
- String old = this.defaultCatalog;
- this.defaultCatalog = catalog;
- this.firePropertyChanged(DEFAULT_CATALOG_PROPERTY, old, catalog);
+ @Override
+ public String getSchema() {
+ return this.schema;
}
- protected String buildDefaultCatalog() {
- return this.getContextDefaultCatalog();
+ protected void setSchema(String schema) {
+ String old = this.schema;
+ this.firePropertyChanged(SCHEMA_PROPERTY, old, this.schema = schema);
}
-
- // ********** schema **********
-
- @Override
- public String getSchema() {
+ protected String buildSchema() {
return (this.specifiedSchema != null) ? this.specifiedSchema : this.defaultSchema;
}
@@ -112,8 +90,7 @@ public class GenericJavaSequenceGenerator2_0
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() {
@@ -122,14 +99,58 @@ public class GenericJavaSequenceGenerator2_0
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() {
return this.getContextDefaultSchema();
}
+
+ // ********** catalog **********
+
+ @Override
+ 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;
+ }
+
+ public String getSpecifiedCatalog() {
+ return this.specifiedCatalog;
+ }
+
+ public void setSpecifiedCatalog(String catalog) {
+ this.generatorAnnotation.setCatalog(catalog);
+ this.setSpecifiedCatalog_(catalog);
+ }
+
+ protected void setSpecifiedCatalog_(String catalog) {
+ String old = this.specifiedCatalog;
+ this.firePropertyChanged(SPECIFIED_CATALOG_PROPERTY, old, this.specifiedCatalog = catalog);
+ }
+
+ public String getDefaultCatalog() {
+ return this.defaultCatalog;
+ }
+
+ protected void setDefaultCatalog(String catalog) {
+ String old = this.defaultCatalog;
+ this.firePropertyChanged(DEFAULT_CATALOG_PROPERTY, old, this.defaultCatalog = catalog);
+ }
+
+ protected String buildDefaultCatalog() {
+ return this.getContextDefaultCatalog();
+ }
+
+
// ********** validation **********
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/GenericOrmSequenceGenerator2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/GenericOrmSequenceGenerator2_0.java
index 2d4fb5048b..899754dd8f 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/GenericOrmSequenceGenerator2_0.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/GenericOrmSequenceGenerator2_0.java
@@ -1,5 +1,5 @@
/*******************************************************************************
-* Copyright (c) 2009, 2015 Oracle. All rights reserved.
+* Copyright (c) 2009, 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.
@@ -28,17 +28,19 @@ public class GenericOrmSequenceGenerator2_0
extends AbstractOrmSequenceGenerator
implements OrmSequenceGenerator2_0
{
- protected String specifiedCatalog;
- protected String defaultCatalog;
-
protected String specifiedSchema;
protected String defaultSchema;
+ protected String schema;
+
+ protected String specifiedCatalog;
+ protected String defaultCatalog;
+ protected String catalog;
public GenericOrmSequenceGenerator2_0(JpaContextModel parent, XmlSequenceGenerator xmlSequenceGenerator) {
super(parent, xmlSequenceGenerator);
- this.specifiedCatalog = xmlSequenceGenerator.getCatalog();
this.specifiedSchema = xmlSequenceGenerator.getSchema();
+ this.specifiedCatalog = xmlSequenceGenerator.getCatalog();
}
@@ -47,59 +49,35 @@ public class GenericOrmSequenceGenerator2_0
@Override
public void synchronizeWithResourceModel(IProgressMonitor monitor) {
super.synchronizeWithResourceModel(monitor);
- this.setSpecifiedCatalog_(this.xmlGenerator.getCatalog());
this.setSpecifiedSchema_(this.xmlGenerator.getSchema());
+ this.setSpecifiedCatalog_(this.xmlGenerator.getCatalog());
}
@Override
public void update(IProgressMonitor monitor) {
super.update(monitor);
- this.setDefaultCatalog(this.buildDefaultCatalog());
- this.setDefaultSchema(this.buildDefaultSchema());
- }
-
- // ********** catalog **********
-
- @Override
- public String getCatalog() {
- return (this.specifiedCatalog != null) ? this.specifiedCatalog : this.defaultCatalog;
- }
-
- public String getSpecifiedCatalog() {
- return this.specifiedCatalog;
- }
+ this.setDefaultSchema(this.buildDefaultSchema());
+ this.setSchema(this.buildSchema());
- public void setSpecifiedCatalog(String catalog) {
- this.setSpecifiedCatalog_(catalog);
- this.xmlGenerator.setCatalog(catalog);
+ this.setDefaultCatalog(this.buildDefaultCatalog());
+ this.setCatalog(this.buildCatalog());
}
- protected void setSpecifiedCatalog_(String catalog) {
- String old = this.specifiedCatalog;
- this.specifiedCatalog = catalog;
- this.firePropertyChanged(SPECIFIED_CATALOG_PROPERTY, old, catalog);
- }
- public String getDefaultCatalog() {
- return this.defaultCatalog;
- }
+ // ********** schema **********
- protected void setDefaultCatalog(String catalog) {
- String old = this.defaultCatalog;
- this.defaultCatalog = catalog;
- this.firePropertyChanged(DEFAULT_CATALOG_PROPERTY, old, catalog);
+ @Override
+ public String getSchema() {
+ return this.schema;
}
- protected String buildDefaultCatalog() {
- return this.getContextDefaultCatalog();
+ protected void setSchema(String schema) {
+ String old = this.schema;
+ this.firePropertyChanged(SCHEMA_PROPERTY, old, this.schema = schema);
}
-
- // ********** schema **********
-
- @Override
- public String getSchema() {
+ protected String buildSchema() {
return (this.specifiedSchema != null) ? this.specifiedSchema : this.defaultSchema;
}
@@ -114,8 +92,7 @@ public class GenericOrmSequenceGenerator2_0
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() {
@@ -124,14 +101,58 @@ public class GenericOrmSequenceGenerator2_0
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() {
return this.getContextDefaultSchema();
}
+
+ // ********** catalog **********
+
+ @Override
+ 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;
+ }
+
+ public String getSpecifiedCatalog() {
+ return this.specifiedCatalog;
+ }
+
+ public void setSpecifiedCatalog(String catalog) {
+ this.setSpecifiedCatalog_(catalog);
+ this.xmlGenerator.setCatalog(catalog);
+ }
+
+ protected void setSpecifiedCatalog_(String catalog) {
+ String old = this.specifiedCatalog;
+ this.firePropertyChanged(SPECIFIED_CATALOG_PROPERTY, old, this.specifiedCatalog = catalog);
+ }
+
+ public String getDefaultCatalog() {
+ return this.defaultCatalog;
+ }
+
+ protected void setDefaultCatalog(String catalog) {
+ String old = this.defaultCatalog;
+ this.firePropertyChanged(DEFAULT_CATALOG_PROPERTY, old, this.defaultCatalog = catalog);
+ }
+
+ protected String buildDefaultCatalog() {
+ return this.getContextDefaultCatalog();
+ }
+
+
// ********** validation **********
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2/context/SequenceGenerator2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2/context/SequenceGenerator2_0.java
index 4c390df246..702d45d88f 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2/context/SequenceGenerator2_0.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/jpa2/context/SequenceGenerator2_0.java
@@ -1,14 +1,15 @@
/*******************************************************************************
-* Copyright (c) 2009, 2010 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.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
+ * Copyright (c) 2009, 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.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
package org.eclipse.jpt.jpa.core.jpa2.context;
+import org.eclipse.jpt.jpa.core.context.ModifiableSpecifiedSchemaReference;
import org.eclipse.jpt.jpa.core.context.SequenceGenerator;
/**
@@ -24,33 +25,7 @@ import org.eclipse.jpt.jpa.core.context.SequenceGenerator;
* @since 2.3
*/
public interface SequenceGenerator2_0
- extends SequenceGenerator
+ extends SequenceGenerator, ModifiableSpecifiedSchemaReference
{
- // ********** catalog **********
-
- /**
- * Return the specified catalog if present, otherwise return the default
- * catalog.
- */
- String getCatalog();
- String getSpecifiedCatalog();
- void setSpecifiedCatalog(String value);
- String SPECIFIED_CATALOG_PROPERTY = "specifiedCatalog"; //$NON-NLS-1$
- String getDefaultCatalog();
- String DEFAULT_CATALOG_PROPERTY = "defaultCatalog"; //$NON-NLS-1$
-
-
- // ********** schema **********
-
- /**
- * Return the specified schema if present, otherwise return the default
- * schema.
- */
- String getSchema();
- String getSpecifiedSchema();
- void setSpecifiedSchema(String value);
- String SPECIFIED_SCHEMA_PROPERTY = "specifiedSchema"; //$NON-NLS-1$
- String getDefaultSchema();
- String DEFAULT_SCHEMA_PROPERTY = "defaultSchema"; //$NON-NLS-1$
-
+ // extend with schema and catalog
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ReferenceTableComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ReferenceTableComposite.java
index 24af64cf59..3edb63c895 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ReferenceTableComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ReferenceTableComposite.java
@@ -29,6 +29,7 @@ import org.eclipse.jpt.jpa.core.context.JoinColumn;
import org.eclipse.jpt.jpa.core.context.ReferenceTable;
import org.eclipse.jpt.jpa.core.context.SpecifiedJoinColumn;
import org.eclipse.jpt.jpa.core.context.SpecifiedReferenceTable;
+import org.eclipse.jpt.jpa.core.context.SpecifiedSchemaReference;
import org.eclipse.jpt.jpa.core.context.Table;
import org.eclipse.jpt.jpa.db.Schema;
import org.eclipse.jpt.jpa.db.SchemaContainer;
@@ -120,8 +121,8 @@ public abstract class ReferenceTableComposite<T extends ReferenceTable>
@Override
protected void addPropertyNames(Collection<String> propertyNames) {
super.addPropertyNames(propertyNames);
- propertyNames.add(Table.DEFAULT_CATALOG_PROPERTY);
- propertyNames.add(Table.SPECIFIED_CATALOG_PROPERTY);
+ propertyNames.add(SpecifiedSchemaReference.DEFAULT_CATALOG_PROPERTY);
+ propertyNames.add(SpecifiedSchemaReference.SPECIFIED_CATALOG_PROPERTY);
}
@Override
@@ -153,8 +154,8 @@ public abstract class ReferenceTableComposite<T extends ReferenceTable>
@Override
protected void addPropertyNames(Collection<String> propertyNames) {
super.addPropertyNames(propertyNames);
- propertyNames.add(Table.DEFAULT_SCHEMA_PROPERTY);
- propertyNames.add(Table.SPECIFIED_SCHEMA_PROPERTY);
+ propertyNames.add(SpecifiedSchemaReference.DEFAULT_SCHEMA_PROPERTY);
+ propertyNames.add(SpecifiedSchemaReference.SPECIFIED_SCHEMA_PROPERTY);
propertyNames.addAll(SCHEMA_PICK_LIST_PROPERTIES);
}
@@ -201,8 +202,8 @@ public abstract class ReferenceTableComposite<T extends ReferenceTable>
}
/* CU private */ static final Collection<String> SCHEMA_PICK_LIST_PROPERTIES = Arrays.asList(new String[] {
- Table.DEFAULT_CATALOG_PROPERTY,
- Table.SPECIFIED_CATALOG_PROPERTY
+ SpecifiedSchemaReference.DEFAULT_CATALOG_PROPERTY,
+ SpecifiedSchemaReference.SPECIFIED_CATALOG_PROPERTY
});
protected TableCombo<T> addTableCombo(Composite container, final String helpId) {
@@ -261,8 +262,8 @@ public abstract class ReferenceTableComposite<T extends ReferenceTable>
/* CU private */ static final Collection<String> TABLE_PICK_LIST_PROPERTIES = Arrays.asList(ArrayTools.addAll(SCHEMA_PICK_LIST_PROPERTIES.toArray(StringTools.EMPTY_STRING_ARRAY),
new String[] {
- Table.DEFAULT_SCHEMA_PROPERTY,
- Table.SPECIFIED_SCHEMA_PROPERTY
+ SpecifiedSchemaReference.DEFAULT_SCHEMA_PROPERTY,
+ SpecifiedSchemaReference.SPECIFIED_SCHEMA_PROPERTY
}
));
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TableComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TableComposite.java
index eac17a7c01..3f0f7b3fa6 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TableComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TableComposite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2015 Oracle. All rights reserved.
+ * Copyright (c) 2007, 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.
@@ -18,6 +18,7 @@ import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter
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.Entity;
+import org.eclipse.jpt.jpa.core.context.SpecifiedSchemaReference;
import org.eclipse.jpt.jpa.core.context.Table;
import org.eclipse.jpt.jpa.core.context.SpecifiedTable;
import org.eclipse.jpt.jpa.db.Schema;
@@ -126,8 +127,8 @@ public class TableComposite extends Pane<Entity>
@Override
protected void addPropertyNames(Collection<String> propertyNames) {
super.addPropertyNames(propertyNames);
- propertyNames.add(Table.DEFAULT_CATALOG_PROPERTY);
- propertyNames.add(Table.SPECIFIED_CATALOG_PROPERTY);
+ propertyNames.add(SpecifiedSchemaReference.DEFAULT_CATALOG_PROPERTY);
+ propertyNames.add(SpecifiedSchemaReference.SPECIFIED_CATALOG_PROPERTY);
}
@Override
@@ -163,8 +164,8 @@ public class TableComposite extends Pane<Entity>
@Override
protected void addPropertyNames(Collection<String> propertyNames) {
super.addPropertyNames(propertyNames);
- propertyNames.add(Table.DEFAULT_SCHEMA_PROPERTY);
- propertyNames.add(Table.SPECIFIED_SCHEMA_PROPERTY);
+ propertyNames.add(SpecifiedSchemaReference.DEFAULT_SCHEMA_PROPERTY);
+ propertyNames.add(SpecifiedSchemaReference.SPECIFIED_SCHEMA_PROPERTY);
propertyNames.addAll(SCHEMA_PICK_LIST_PROPERTIES);
}
@@ -210,8 +211,8 @@ public class TableComposite extends Pane<Entity>
}
/* CU private */ static final Collection<String> SCHEMA_PICK_LIST_PROPERTIES = Arrays.asList(new String[] {
- Table.DEFAULT_CATALOG_PROPERTY,
- Table.SPECIFIED_CATALOG_PROPERTY
+ SpecifiedSchemaReference.DEFAULT_CATALOG_PROPERTY,
+ SpecifiedSchemaReference.SPECIFIED_CATALOG_PROPERTY
});
private TableCombo<SpecifiedTable> addTableCombo(PropertyValueModel<SpecifiedTable> subjectHolder, PropertyValueModel<Boolean> enabledModel, Composite container) {
@@ -268,8 +269,8 @@ public class TableComposite extends Pane<Entity>
/* CU private */ static final Collection<String> TABLE_PICK_LIST_PROPERTIES = Arrays.asList(ArrayTools.addAll(SCHEMA_PICK_LIST_PROPERTIES.toArray(StringTools.EMPTY_STRING_ARRAY),
new String[] {
- Table.DEFAULT_SCHEMA_PROPERTY,
- Table.SPECIFIED_SCHEMA_PROPERTY
+ SpecifiedSchemaReference.DEFAULT_SCHEMA_PROPERTY,
+ SpecifiedSchemaReference.SPECIFIED_SCHEMA_PROPERTY
}
));
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TableGeneratorComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TableGeneratorComposite.java
index 3f206f2fc8..df8fe28b26 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TableGeneratorComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TableGeneratorComposite.java
@@ -18,6 +18,7 @@ import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.jpa.core.JpaProject;
import org.eclipse.jpt.jpa.core.context.GeneratorContainer;
import org.eclipse.jpt.jpa.core.context.IdMapping;
+import org.eclipse.jpt.jpa.core.context.SpecifiedSchemaReference;
import org.eclipse.jpt.jpa.core.context.TableGenerator;
import org.eclipse.jpt.jpa.db.Schema;
import org.eclipse.jpt.jpa.db.SchemaContainer;
@@ -140,8 +141,8 @@ public class TableGeneratorComposite extends GeneratorComposite<TableGenerator>
@Override
protected void addPropertyNames(Collection<String> propertyNames) {
super.addPropertyNames(propertyNames);
- propertyNames.add(TableGenerator.DEFAULT_CATALOG_PROPERTY);
- propertyNames.add(TableGenerator.SPECIFIED_CATALOG_PROPERTY);
+ propertyNames.add(SpecifiedSchemaReference.DEFAULT_CATALOG_PROPERTY);
+ propertyNames.add(SpecifiedSchemaReference.SPECIFIED_CATALOG_PROPERTY);
}
@Override
@@ -298,8 +299,8 @@ public class TableGeneratorComposite extends GeneratorComposite<TableGenerator>
@Override
protected void addPropertyNames(Collection<String> propertyNames) {
super.addPropertyNames(propertyNames);
- propertyNames.add(TableGenerator.DEFAULT_SCHEMA_PROPERTY);
- propertyNames.add(TableGenerator.SPECIFIED_SCHEMA_PROPERTY);
+ propertyNames.add(SpecifiedSchemaReference.DEFAULT_SCHEMA_PROPERTY);
+ propertyNames.add(SpecifiedSchemaReference.SPECIFIED_SCHEMA_PROPERTY);
propertyNames.addAll(SCHEMA_PICK_LIST_PROPERTIES);
}
@@ -495,14 +496,14 @@ public class TableGeneratorComposite extends GeneratorComposite<TableGenerator>
}
/* CU private */ static final Collection<String> SCHEMA_PICK_LIST_PROPERTIES = Arrays.asList(new String[] {
- TableGenerator.DEFAULT_CATALOG_PROPERTY,
- TableGenerator.SPECIFIED_CATALOG_PROPERTY
+ SpecifiedSchemaReference.DEFAULT_CATALOG_PROPERTY,
+ SpecifiedSchemaReference.SPECIFIED_CATALOG_PROPERTY
});
/* CU private */ static final Collection<String> TABLE_PICK_LIST_PROPERTIES = Arrays.asList(ArrayTools.addAll(SCHEMA_PICK_LIST_PROPERTIES.toArray(StringTools.EMPTY_STRING_ARRAY),
new String[] {
- TableGenerator.DEFAULT_SCHEMA_PROPERTY,
- TableGenerator.SPECIFIED_SCHEMA_PROPERTY
+ SpecifiedSchemaReference.DEFAULT_SCHEMA_PROPERTY,
+ SpecifiedSchemaReference.SPECIFIED_SCHEMA_PROPERTY
}
));
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractEntityMappingsDetailsPageManager.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractEntityMappingsDetailsPageManager.java
index 45532793cf..e07440bad6 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractEntityMappingsDetailsPageManager.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractEntityMappingsDetailsPageManager.java
@@ -17,6 +17,7 @@ import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelTools;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.jpa.core.context.QueryContainer;
+import org.eclipse.jpt.jpa.core.context.SpecifiedSchemaReference;
import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistenceUnitMetadata;
import org.eclipse.jpt.jpa.db.SchemaContainer;
@@ -159,8 +160,8 @@ public abstract class AbstractEntityMappingsDetailsPageManager
@Override
protected void addPropertyNames(Collection<String> propertyNames) {
super.addPropertyNames(propertyNames);
- propertyNames.add(EntityMappings.DEFAULT_CATALOG_PROPERTY);
- propertyNames.add(EntityMappings.SPECIFIED_CATALOG_PROPERTY);
+ propertyNames.add(SpecifiedSchemaReference.DEFAULT_CATALOG_PROPERTY);
+ propertyNames.add(SpecifiedSchemaReference.SPECIFIED_CATALOG_PROPERTY);
}
@Override
@@ -200,8 +201,8 @@ public abstract class AbstractEntityMappingsDetailsPageManager
@Override
protected void addPropertyNames(Collection<String> propertyNames) {
super.addPropertyNames(propertyNames);
- propertyNames.add(EntityMappings.DEFAULT_SCHEMA_PROPERTY);
- propertyNames.add(EntityMappings.SPECIFIED_SCHEMA_PROPERTY);
+ propertyNames.add(SpecifiedSchemaReference.DEFAULT_SCHEMA_PROPERTY);
+ propertyNames.add(SpecifiedSchemaReference.SPECIFIED_SCHEMA_PROPERTY);
propertyNames.addAll(SCHEMA_PICK_LIST_PROPERTIES);
}
@@ -247,8 +248,8 @@ public abstract class AbstractEntityMappingsDetailsPageManager
}
/* CU private */ static final Collection<String> SCHEMA_PICK_LIST_PROPERTIES = Arrays.asList(new String[] {
- EntityMappings.DEFAULT_CATALOG_PROPERTY,
- EntityMappings.SPECIFIED_CATALOG_PROPERTY
+ SpecifiedSchemaReference.DEFAULT_CATALOG_PROPERTY,
+ SpecifiedSchemaReference.SPECIFIED_CATALOG_PROPERTY
});
protected void initializeGeneratorsCollapsibleSection(Composite container) {
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/PersistenceUnitMetadataComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/PersistenceUnitMetadataComposite.java
index 2e89108455..d92c8ad071 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/PersistenceUnitMetadataComposite.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/PersistenceUnitMetadataComposite.java
@@ -20,6 +20,8 @@ import org.eclipse.jpt.common.utility.internal.model.value.PropertyValueModelToo
import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.common.utility.predicate.Predicate;
+import org.eclipse.jpt.jpa.core.context.MappingFilePersistenceUnitDefaults;
+import org.eclipse.jpt.jpa.core.context.SpecifiedSchemaReference;
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistenceUnitDefaults;
import org.eclipse.jpt.jpa.core.context.orm.OrmPersistenceUnitMetadata;
import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.GenericOrmXmlDefinition2_0;
@@ -97,7 +99,7 @@ public class PersistenceUnitMetadataComposite
}
protected ModifiablePropertyValueModel<Boolean> buildCascadePersistModel() {
- return new PropertyAspectAdapterXXXX<OrmPersistenceUnitDefaults, Boolean>(getPersistenceUnitDefaultsModel(), OrmPersistenceUnitDefaults.CASCADE_PERSIST_PROPERTY) {
+ return new PropertyAspectAdapterXXXX<OrmPersistenceUnitDefaults, Boolean>(getPersistenceUnitDefaultsModel(), MappingFilePersistenceUnitDefaults.CASCADE_PERSIST_PROPERTY) {
@Override
protected Boolean buildValue_() {
return Boolean.valueOf(this.subject.isCascadePersist());
@@ -117,8 +119,8 @@ public class PersistenceUnitMetadataComposite
@Override
protected void addPropertyNames(Collection<String> propertyNames) {
super.addPropertyNames(propertyNames);
- propertyNames.add(OrmPersistenceUnitDefaults.DEFAULT_CATALOG_PROPERTY);
- propertyNames.add(OrmPersistenceUnitDefaults.SPECIFIED_CATALOG_PROPERTY);
+ propertyNames.add(SpecifiedSchemaReference.DEFAULT_CATALOG_PROPERTY);
+ propertyNames.add(SpecifiedSchemaReference.SPECIFIED_CATALOG_PROPERTY);
}
@Override
@@ -159,8 +161,8 @@ public class PersistenceUnitMetadataComposite
@Override
protected void addPropertyNames(Collection<String> propertyNames) {
super.addPropertyNames(propertyNames);
- propertyNames.add(OrmPersistenceUnitDefaults.DEFAULT_SCHEMA_PROPERTY);
- propertyNames.add(OrmPersistenceUnitDefaults.SPECIFIED_SCHEMA_PROPERTY);
+ propertyNames.add(SpecifiedSchemaReference.DEFAULT_SCHEMA_PROPERTY);
+ propertyNames.add(SpecifiedSchemaReference.SPECIFIED_SCHEMA_PROPERTY);
propertyNames.addAll(SCHEMA_PICK_LIST_PROPERTIES);
}
@@ -206,8 +208,8 @@ public class PersistenceUnitMetadataComposite
}
/* CU private */ static final Collection<String> SCHEMA_PICK_LIST_PROPERTIES = Arrays.asList(new String[] {
- OrmPersistenceUnitDefaults.DEFAULT_CATALOG_PROPERTY,
- OrmPersistenceUnitDefaults.SPECIFIED_CATALOG_PROPERTY
+ SpecifiedSchemaReference.DEFAULT_CATALOG_PROPERTY,
+ SpecifiedSchemaReference.SPECIFIED_CATALOG_PROPERTY
});
protected ModifiablePropertyValueModel<Boolean> buildXmlMappingMetadataCompleteModel() {
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/SequenceGeneratorComposite2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/SequenceGeneratorComposite2_0.java
index f594965ff6..b973970eb9 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/SequenceGeneratorComposite2_0.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/SequenceGeneratorComposite2_0.java
@@ -17,6 +17,7 @@ import org.eclipse.jpt.common.utility.internal.StringTools;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
import org.eclipse.jpt.jpa.core.JpaProject;
import org.eclipse.jpt.jpa.core.context.SequenceGenerator;
+import org.eclipse.jpt.jpa.core.context.SpecifiedSchemaReference;
import org.eclipse.jpt.jpa.core.jpa2.context.SequenceGenerator2_0;
import org.eclipse.jpt.jpa.db.SchemaContainer;
import org.eclipse.jpt.jpa.ui.details.JptJpaUiDetailsMessages;
@@ -75,8 +76,8 @@ public class SequenceGeneratorComposite2_0 extends SequenceGeneratorComposite
@Override
protected void addPropertyNames(Collection<String> propertyNames) {
super.addPropertyNames(propertyNames);
- propertyNames.add(SequenceGenerator2_0.DEFAULT_CATALOG_PROPERTY);
- propertyNames.add(SequenceGenerator2_0.SPECIFIED_CATALOG_PROPERTY);
+ propertyNames.add(SpecifiedSchemaReference.DEFAULT_CATALOG_PROPERTY);
+ propertyNames.add(SpecifiedSchemaReference.SPECIFIED_CATALOG_PROPERTY);
}
@Override
@@ -116,8 +117,8 @@ public class SequenceGeneratorComposite2_0 extends SequenceGeneratorComposite
@Override
protected void addPropertyNames(Collection<String> propertyNames) {
super.addPropertyNames(propertyNames);
- propertyNames.add(SequenceGenerator2_0.DEFAULT_SCHEMA_PROPERTY);
- propertyNames.add(SequenceGenerator2_0.SPECIFIED_SCHEMA_PROPERTY);
+ propertyNames.add(SpecifiedSchemaReference.DEFAULT_SCHEMA_PROPERTY);
+ propertyNames.add(SpecifiedSchemaReference.SPECIFIED_SCHEMA_PROPERTY);
propertyNames.addAll(SCHEMA_PICK_LIST_PROPERTIES);
}
@@ -176,8 +177,8 @@ public class SequenceGeneratorComposite2_0 extends SequenceGeneratorComposite
}
/* CU private */ static final Collection<String> SCHEMA_PICK_LIST_PROPERTIES = Arrays.asList(new String[] {
- SequenceGenerator2_0.DEFAULT_CATALOG_PROPERTY,
- SequenceGenerator2_0.SPECIFIED_CATALOG_PROPERTY
+ SpecifiedSchemaReference.DEFAULT_CATALOG_PROPERTY,
+ SpecifiedSchemaReference.SPECIFIED_CATALOG_PROPERTY
});
@Override
@@ -210,8 +211,8 @@ public class SequenceGeneratorComposite2_0 extends SequenceGeneratorComposite
/* CU private */ static final Collection<String> SEQUENCE_PICK_LIST_PROPERTIES = Arrays.asList(ArrayTools.addAll(SCHEMA_PICK_LIST_PROPERTIES.toArray(StringTools.EMPTY_STRING_ARRAY),
new String[] {
- SequenceGenerator2_0.DEFAULT_SCHEMA_PROPERTY,
- SequenceGenerator2_0.SPECIFIED_SCHEMA_PROPERTY
+ SpecifiedSchemaReference.DEFAULT_SCHEMA_PROPERTY,
+ SpecifiedSchemaReference.SPECIFIED_SCHEMA_PROPERTY
}
));
}

Back to the top