From 6349663d713c8011588669e8c4efbdf035e23f01 Mon Sep 17 00:00:00 2001 From: bvosburgh Date: Fri, 28 Jan 2011 23:01:02 +0000 Subject: rename some methods --- .../jpt/core/context/JoinColumnRelationship.java | 17 ++- .../context/JoinColumnRelationshipStrategy.java | 10 +- .../jpt/core/context/JoinTableRelationship.java | 17 ++- .../jpt/core/context/MappedByRelationship.java | 30 ++-- .../core/context/MappedByRelationshipStrategy.java | 6 +- .../jpt/core/context/MappingRelationship.java | 7 +- .../context/PrimaryKeyJoinColumnRelationship.java | 25 ++-- .../PrimaryKeyJoinColumnRelationshipStrategy.java | 21 ++- .../context/ReadOnlyJoinColumnRelationship.java | 30 ++-- .../context/ReadOnlyJoinTableRelationship.java | 28 ++-- .../jpt/core/context/ReadOnlyRelationship.java | 4 +- .../core/context/ReadOnlyRelationshipStrategy.java | 4 +- .../org/eclipse/jpt/core/context/Relationship.java | 4 +- .../jpt/core/context/RelationshipStrategy.java | 8 +- .../context/VirtualJoinColumnRelationship.java | 2 +- .../core/context/VirtualJoinTableRelationship.java | 2 +- .../jpt/core/context/VirtualRelationship.java | 2 +- .../context/java/JavaJoinColumnRelationship.java | 2 +- .../context/java/JavaJoinTableRelationship.java | 2 +- .../context/java/JavaMappedByRelationship.java | 2 +- .../java/JavaPrimaryKeyJoinColumnRelationship.java | 2 +- .../context/java/JavaReadOnlyRelationship.java | 2 +- .../jpt/core/context/java/JavaRelationship.java | 2 +- .../java/JavaVirtualJoinColumnRelationship.java | 2 +- .../java/JavaVirtualJoinTableRelationship.java | 2 +- .../core/context/java/JavaVirtualRelationship.java | 2 +- .../context/orm/OrmJoinColumnRelationship.java | 2 +- .../core/context/orm/OrmJoinTableRelationship.java | 2 +- .../core/context/orm/OrmMappedByRelationship.java | 2 +- .../orm/OrmPrimaryKeyJoinColumnRelationship.java | 2 +- .../core/context/orm/OrmReadOnlyRelationship.java | 2 +- .../jpt/core/context/orm/OrmRelationship.java | 2 +- .../orm/OrmVirtualJoinColumnRelationship.java | 2 +- .../orm/OrmVirtualJoinTableRelationship.java | 2 +- .../core/context/orm/OrmVirtualRelationship.java | 2 +- .../java/AbstractJavaMappingRelationship.java | 4 +- .../java/AbstractJavaMultiRelationshipMapping.java | 4 +- .../java/GenericJavaManyToManyRelationship.java | 22 +-- .../java/GenericJavaManyToOneRelationship.java | 16 +- .../GenericJavaMappedByRelationshipStrategy.java | 8 +- .../java/GenericJavaOneToManyRelationship.java | 28 ++-- .../java/GenericJavaOneToOneRelationship.java | 34 ++--- .../orm/AbstractOrmMappingRelationship.java | 4 +- .../orm/AbstractOrmMultiRelationshipMapping.java | 22 +-- .../orm/GenericOrmManyToManyRelationship.java | 20 +-- .../orm/GenericOrmManyToOneRelationship.java | 16 +- .../GenericOrmMappedByRelationshipStrategy.java | 8 +- .../orm/GenericOrmOneToManyRelationship.java | 28 ++-- .../orm/GenericOrmOneToOneRelationship.java | 34 ++--- ...tualOverrideJoinColumnRelationshipStrategy.java | 2 +- .../java/GenericJavaOverrideRelationship.java | 26 ++-- ...tualOverrideJoinColumnRelationshipStrategy.java | 2 +- .../GenericJavaVirtualOverrideRelationship.java | 12 +- .../orm/GenericOrmOverrideRelationship.java | 24 +-- .../orm/GenericOrmVirtualOverrideRelationship.java | 12 +- ...alOverrideJoinTableRelationshipStrategy2_0.java | 2 +- ...alOverrideJoinTableRelationshipStrategy2_0.java | 2 +- .../context/java/JavaOverrideRelationship2_0.java | 2 +- .../java/JavaVirtualOverrideRelationship2_0.java | 2 +- .../context/orm/OrmOverrideRelationship2_0.java | 2 +- .../orm/OrmVirtualOverrideRelationship2_0.java | 2 +- .../details/JoinColumnJoiningStrategyPane.java | 8 +- .../details/JoinTableJoiningStrategyPane.java | 8 +- .../details/ManyToManyJoiningStrategyPane.java | 12 +- .../details/MappedByJoiningStrategyPane.java | 8 +- .../PrimaryKeyJoinColumnJoiningStrategyPane.java | 8 +- .../context/java/JavaAssociationOverrideTests.java | 8 +- .../internal/context/java/JavaEntityTests.java | 6 +- .../internal/context/java/JavaJoinColumnTests.java | 28 ++-- .../internal/context/java/JavaJoinTableTests.java | 70 ++++----- .../context/java/JavaManyToManyMappingTests.java | 78 +++++----- .../context/java/JavaManyToOneMappingTests.java | 50 +++---- .../context/java/JavaOneToManyMappingTests.java | 78 +++++----- .../context/java/JavaOneToOneMappingTests.java | 136 ++++++++--------- .../context/orm/OrmAssociationOverrideTests.java | 8 +- .../tests/internal/context/orm/OrmEntityTests.java | 14 +- .../internal/context/orm/OrmJoinColumnTests.java | 32 ++-- .../internal/context/orm/OrmJoinTableTests.java | 68 ++++----- .../context/orm/OrmManyToManyMappingTests.java | 62 ++++---- .../context/orm/OrmManyToOneMappingTests.java | 24 +-- .../context/orm/OrmOneToManyMappingTests.java | 84 +++++------ .../context/orm/OrmOneToOneMappingTests.java | 148 +++++++++---------- .../GenericJavaAssociationOverride2_0Tests.java | 20 +-- .../java/GenericJavaEmbeddedMapping2_0Tests.java | 12 +- .../context/java/GenericJavaEntity2_0Tests.java | 2 +- .../java/GenericJavaManyToManyMapping2_0Tests.java | 24 +-- .../java/GenericJavaManyToOneMapping2_0Tests.java | 42 +++--- .../java/GenericJavaOneToManyMapping2_0Tests.java | 98 ++++++------- .../java/GenericJavaOneToOneMapping2_0Tests.java | 132 ++++++++--------- .../orm/GenericOrmAssociationOverride2_0Tests.java | 22 +-- .../orm/GenericOrmEmbeddedMapping2_0Tests.java | 18 +-- .../jpa2/context/orm/GenericOrmEntity2_0Tests.java | 2 +- .../orm/GenericOrmManyToManyMapping2_0Tests.java | 26 ++-- .../orm/GenericOrmManyToOneMapping2_0Tests.java | 64 ++++---- .../orm/GenericOrmOneToManyMapping2_0Tests.java | 116 +++++++-------- .../orm/GenericOrmOneToOneMapping2_0Tests.java | 162 ++++++++++----------- .../java/EclipseLinkJavaOneToManyMappingTests.java | 76 +++++----- .../java/EclipseLinkJavaOneToOneMappingTests.java | 4 +- .../orm/EclipseLinkOrmManyToManyMappingTests.java | 12 +- .../orm/EclipseLinkOrmManyToOneMappingTests.java | 2 +- .../orm/EclipseLinkOrmOneToManyMappingTests.java | 84 +++++------ .../orm/EclipseLinkOrmOneToOneMappingTests.java | 10 +- .../EclipseLink2_0JavaManyToManyMappingTests.java | 22 +-- .../EclipseLink2_0JavaManyToOneMappingTests.java | 42 +++--- .../EclipseLink2_0JavaOneToManyMappingTests.java | 86 +++++------ .../EclipseLink2_0JavaOneToOneMappingTests.java | 132 ++++++++--------- .../EclipseLink2_0OrmManyToManyMappingTests.java | 26 ++-- .../EclipseLink2_0OrmOneToManyMappingTests.java | 104 ++++++------- .../orm/EclipseLink2_0OrmOneToOneMappingTests.java | 162 ++++++++++----------- .../Eclipselink2_0OrmManyToOneMappingTests.java | 64 ++++---- 110 files changed, 1560 insertions(+), 1535 deletions(-) diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinColumnRelationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinColumnRelationship.java index 9409909b44..37757469b4 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinColumnRelationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinColumnRelationship.java @@ -10,7 +10,12 @@ package org.eclipse.jpt.core.context; /** - * Join column relationship (1:1, 1:m, m:1, and association override) + * Join column relationship *

* Provisional API: This interface is part of an interim API that is still * under development and expected to change significantly before reaching @@ -28,14 +33,10 @@ package org.eclipse.jpt.core.context; public interface JoinColumnRelationship extends ReadOnlyJoinColumnRelationship, Relationship { - /** - * Return the aggregate (never null) object used to configure - * the join column strategy - */ - JoinColumnRelationshipStrategy getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy getJoinColumnStrategy(); /** - * Set the join column strategy as the strategy + * Set the relationship's strategy to the join column strategy. */ - void setJoinColumnJoiningStrategy(); + void setStrategyToJoinColumn(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinColumnRelationshipStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinColumnRelationshipStrategy.java index cf5c2df911..2f02b9d2a1 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinColumnRelationshipStrategy.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinColumnRelationshipStrategy.java @@ -46,24 +46,22 @@ public interface JoinColumnRelationshipStrategy JoinColumn getSpecifiedJoinColumn(int index); /** - * Add a specified join column to the join table return the object - * representing it. + * Add a specified join column to the relationship. */ JoinColumn addSpecifiedJoinColumn(); /** - * Add a specified join column to the join table return the object - * representing it. + * Add a specified join column to the relationship. */ JoinColumn addSpecifiedJoinColumn(int index); /** - * Remove the specified join column from the join table. + * Remove the specified join column. */ void removeSpecifiedJoinColumn(int index); /** - * Remove the specified join column at the index from the join table. + * Remove the specified join column. */ void removeSpecifiedJoinColumn(JoinColumn joinColumn); diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinTableRelationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinTableRelationship.java index 9893d9b5f3..5fd5581aa7 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinTableRelationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/JoinTableRelationship.java @@ -10,8 +10,13 @@ package org.eclipse.jpt.core.context; /** - * Join table relationship (1:1 (JPA 2.0), 1:m, m:1 (JPA 2.0), m:m, - * and association override (JPA 2.0)) + * Join table relationship

*

* Provisional API: This interface is part of an interim API that is still * under development and expected to change significantly before reaching @@ -25,10 +30,10 @@ package org.eclipse.jpt.core.context; public interface JoinTableRelationship extends ReadOnlyJoinTableRelationship, Relationship { - JoinTableRelationshipStrategy getJoinTableJoiningStrategy(); - + JoinTableRelationshipStrategy getJoinTableStrategy(); + /** - * Set the join table strategy as the strategy + * Set the relationship's strategy to the join table strategy. */ - void setJoinTableJoiningStrategy(); + void setStrategyToJoinTable(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappedByRelationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappedByRelationship.java index 26355eea26..f846602f1d 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappedByRelationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappedByRelationship.java @@ -10,7 +10,11 @@ package org.eclipse.jpt.core.context; /** - * "Mapped by" relationship + * "Mapped by" relationship

*

* Provisional API: This interface is part of an interim API that is still * under development and expected to change significantly before reaching @@ -25,24 +29,24 @@ public interface MappedByRelationship extends Relationship { /** - * Return the aggregate (never null) object used to configure - * the "mapped by" strategy + * Return the (never null) strategy used to configure + * the relationship's "mapped by" strategy. */ - MappedByRelationshipStrategy getMappedByJoiningStrategy(); - + MappedByRelationshipStrategy getMappedByStrategy(); + /** - * Return whether the mapped by joining strategy is currently the predominant - * joining strategy + * Return whether the "mapped by" strategy is the + * relationship's current strategy. */ - boolean usesMappedByJoiningStrategy(); - + boolean strategyIsMappedBy(); + /** - * Set the mapped by joining strategy as the predominant joining strategy + * Set the relationship's strategy to the "mapped by" strategy. */ - void setMappedByJoiningStrategy(); - + void setStrategyToMappedBy(); + /** - * Validates whether the given mapping may own the relationship + * Return whether the specified mapping may own the relationship. */ boolean mayBeMappedBy(AttributeMapping mapping); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappedByRelationshipStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappedByRelationshipStrategy.java index da670e5c80..afde7fed95 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappedByRelationshipStrategy.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappedByRelationshipStrategy.java @@ -37,14 +37,12 @@ public interface MappedByRelationshipStrategy String MAPPED_BY_ATTRIBUTE_PROPERTY = "mappedByAttribute"; //$NON-NLS-1$ /** - * Return the attribute of this object. A null indicates that the resource - * element does not exist + * Return the name of the attribute that maps the relationship. */ String getMappedByAttribute(); /** - * Set the attribute of this object. A null will result in removal of the - * resource element + * Set the name of the attribute that maps the relationship. */ void setMappedByAttribute(String attribute); diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappingRelationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappingRelationship.java index 96688a1fe1..579a7757ef 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappingRelationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/MappingRelationship.java @@ -10,7 +10,12 @@ package org.eclipse.jpt.core.context; /** - * Mapping relationship (1:1, 1:m, m:1, m:m) + * Mapping relationship

*

* Provisional API: This interface is part of an interim API that is still * under development and expected to change significantly before reaching diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PrimaryKeyJoinColumnRelationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PrimaryKeyJoinColumnRelationship.java index 3320bf24ee..f1e7267a82 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PrimaryKeyJoinColumnRelationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PrimaryKeyJoinColumnRelationship.java @@ -10,7 +10,9 @@ package org.eclipse.jpt.core.context; /** - * Primary key join column relationship + * Primary key join column relationship

*

* Provisional API: This interface is part of an interim API that is still * under development and expected to change significantly before reaching @@ -25,20 +27,19 @@ public interface PrimaryKeyJoinColumnRelationship extends Relationship { /** - * Return the aggregate (never null) object used to configure - * the primary key join column strategy + * Return the (never null) strategy used to configure + * the relationship's primary key join column strategy. */ - PrimaryKeyJoinColumnRelationshipStrategy getPrimaryKeyJoinColumnJoiningStrategy(); - + PrimaryKeyJoinColumnRelationshipStrategy getPrimaryKeyJoinColumnStrategy(); + /** - * Return whether the primary key join column joining strategy is currently - * the predominant joining strategy + * Return whether the primary key join column strategy is the + * relationship's current strategy. */ - boolean usesPrimaryKeyJoinColumnJoiningStrategy(); - + boolean strategyIsPrimaryKeyJoinColumn(); + /** - * Set the primary key join column joining strategy as the predominant - * joining strategy + * Set the relationship's strategy to the primary key join column strategy. */ - void setPrimaryKeyJoinColumnJoiningStrategy(); + void setStrategyToPrimaryKeyJoinColumn(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PrimaryKeyJoinColumnRelationshipStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PrimaryKeyJoinColumnRelationshipStrategy.java index 460d2dadd3..e61700cc8d 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PrimaryKeyJoinColumnRelationshipStrategy.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/PrimaryKeyJoinColumnRelationshipStrategy.java @@ -35,19 +35,18 @@ public interface PrimaryKeyJoinColumnRelationshipStrategy String PRIMARY_KEY_JOIN_COLUMNS_LIST = "primaryKeyJoinColumns"; //$NON-NLS-1$ /** - * Return a list iterator of the primary key join columns. - * This will not be null. + * Return the strategy's primary key join columns. */ ListIterator primaryKeyJoinColumns(); /** - * Return the number of join columns, both specified and default. + * Return the number of primary key join columns. */ int primaryKeyJoinColumnsSize(); /** - * Return whether this has any primary key join columns. - * (Equivalent to {@link #primaryKeyJoinColumnsSize()} == 0) + * Return whether the relationship has any primary key join columns. + * (Equivalent to {@link #primaryKeyJoinColumnsSize()} == 0.) */ boolean hasPrimaryKeyJoinColumns(); @@ -57,29 +56,27 @@ public interface PrimaryKeyJoinColumnRelationshipStrategy PrimaryKeyJoinColumn getPrimaryKeyJoinColumn(int index); /** - * Add a specified join column to the join table return the object - * representing it. + * Add a primary key join column. */ PrimaryKeyJoinColumn addPrimaryKeyJoinColumn(); /** - * Add a specified join column to the join table return the object - * representing it. + * Add a primary key join column. */ PrimaryKeyJoinColumn addPrimaryKeyJoinColumn(int index); /** - * Remove the specified join column from the join table. + * Remove the specified primary key join column. */ void removePrimaryKeyJoinColumn(int index); /** - * Remove the specified join column at the index from the join table. + * Remove the specified primary key join column. */ void removePrimaryKeyJoinColumn(PrimaryKeyJoinColumn primaryKeyJoinColumn); /** - * Move the specified join column from the source index to the target index. + * Remove the specified primary key join column. */ void movePrimaryKeyJoinColumn(int targetIndex, int sourceIndex); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ReadOnlyJoinColumnRelationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ReadOnlyJoinColumnRelationship.java index 754abe5545..421dcd705c 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ReadOnlyJoinColumnRelationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ReadOnlyJoinColumnRelationship.java @@ -10,7 +10,12 @@ package org.eclipse.jpt.core.context; /** - * Join column relationship (1:1, 1:m, m:1, and association override) + * Join column relationship

*

* Provisional API: This interface is part of an interim API that is still * under development and expected to change significantly before reaching @@ -26,20 +31,23 @@ public interface ReadOnlyJoinColumnRelationship extends ReadOnlyRelationship { /** - * Return the aggregate (never null) object used to configure - * the join column strategy + * Return the (never null) strategy used to configure + * the relationship's join column strategy. */ - ReadOnlyJoinColumnRelationshipStrategy getJoinColumnJoiningStrategy(); - + ReadOnlyJoinColumnRelationshipStrategy getJoinColumnStrategy(); + /** - * Return whether the join column strategy is currently the strategy + * Return whether the join column strategy is the + * relationship's current strategy. */ - boolean usesJoinColumnJoiningStrategy(); - + boolean strategyIsJoinColumn(); + /** - * Return whether this reference may potentially have a default join column. - * (For example, a 1-1 mapping may have one if it does not specify a mappedBy - * or a join table, but a 1-M mapping may not.) + * Return whether this relationship may potentially have a default join + * column. For example, a 1-1 mapping may have a default join column + * if it does not specify a "mapped by" attribute or a join table; + * but a 1-M mapping does not support a default join column in any + * situation. */ boolean mayHaveDefaultJoinColumn(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ReadOnlyJoinTableRelationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ReadOnlyJoinTableRelationship.java index 31af17bc78..333f1fb863 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ReadOnlyJoinTableRelationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ReadOnlyJoinTableRelationship.java @@ -10,8 +10,13 @@ package org.eclipse.jpt.core.context; /** - * Join table relationship (1:1 (JPA 2.0), 1:m, m:1 (JPA 2.0), m:m, - * and association override (JPA 2.0)) + * Join table relationship

*

* Provisional API: This interface is part of an interim API that is still * under development and expected to change significantly before reaching @@ -23,20 +28,23 @@ public interface ReadOnlyJoinTableRelationship extends ReadOnlyRelationship { /** - * Return the aggregate (never null) object used to configure - * the join table strategy + * Return the (never null) strategy used to configure + * the relationship's join table strategy. */ - ReadOnlyJoinTableRelationshipStrategy getJoinTableJoiningStrategy(); + ReadOnlyJoinTableRelationshipStrategy getJoinTableStrategy(); /** - * Return whether the join table strategy is currently the strategy + * Return whether the join table strategy is the + * relationship's current strategy. */ - boolean usesJoinTableJoiningStrategy(); + boolean strategyIsJoinTable(); /** - * Return whether this reference may potentially have a default join table. - * (For example, a M-M mapping may have one if it does not specify a - * mappedBy) + * Return whether this relationship may potentially have a default join + * table. For example, a M-M mapping may have a default join table + * if it does not specify a "mapped by" attribute or a join table; + * but a M-1 mapping does not support a default join table in any + * situation. */ boolean mayHaveDefaultJoinTable(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ReadOnlyRelationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ReadOnlyRelationship.java index a9dfcb63b7..1d1c7e52ed 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ReadOnlyRelationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ReadOnlyRelationship.java @@ -58,12 +58,12 @@ public interface ReadOnlyRelationship /** * String associated with changes to the predominant strategy property */ - final static String PREDOMINANT_JOINING_STRATEGY_PROPERTY = "predominantStrategy"; //$NON-NLS-1$ + final static String STRATEGY_PROPERTY = "strategy"; //$NON-NLS-1$ /** * Return the current strategy, this is never null. */ - ReadOnlyRelationshipStrategy getPredominantJoiningStrategy(); + ReadOnlyRelationshipStrategy getStrategy(); /** * Return whether the the relationship is virtual. diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ReadOnlyRelationshipStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ReadOnlyRelationshipStrategy.java index 75d2b94ede..5a94f348d9 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ReadOnlyRelationshipStrategy.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/ReadOnlyRelationshipStrategy.java @@ -37,8 +37,8 @@ public interface ReadOnlyRelationshipStrategy /** * Return the table name associated with the strategy's columns. - * The join table name, for instance, or in the case of a bi-directional relationship, - * the table of the owning relationship. + * The join table name, for instance, or in the case of a bi-directional + * relationship, the table of the owning relationship. */ String getTableName(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Relationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Relationship.java index 16f924029b..d7e3977276 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Relationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/Relationship.java @@ -25,7 +25,7 @@ package org.eclipse.jpt.core.context; public interface Relationship extends ReadOnlyRelationship { - RelationshipStrategy getPredominantJoiningStrategy(); + RelationshipStrategy getStrategy(); // ********** conversions ********** @@ -38,5 +38,5 @@ public interface Relationship void initializeFromJoinTableRelationship(ReadOnlyJoinTableRelationship oldRelationship); - // we only have a single "implementation" of the primary key relationship (1:1) + // we only have a single "client" of the primary key relationship (1:1 mapping) } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/RelationshipStrategy.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/RelationshipStrategy.java index 2bcdb642d8..e6b6efc33f 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/RelationshipStrategy.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/RelationshipStrategy.java @@ -35,21 +35,21 @@ import org.eclipse.jpt.db.Table; public interface RelationshipStrategy extends ReadOnlyRelationshipStrategy { -// TODO bjv rename to RelationshipStrategy - move to inside Relationship interface? Relationship getRelationship(); /** - * Add this strategy to the relationship reference. + * Add this strategy to the relationship. */ void addStrategy(); /** - * Remove this strategy from the relationship reference. + * Remove this strategy from the relationship. */ void removeStrategy(); /** - * Return whether the mapping can be overridden with an association override. + * Return whether the relationship's mapping can be overridden with an + * association override. */ boolean isOverridable(); diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/VirtualJoinColumnRelationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/VirtualJoinColumnRelationship.java index 5d80c8af54..1fc33ecec6 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/VirtualJoinColumnRelationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/VirtualJoinColumnRelationship.java @@ -22,5 +22,5 @@ public interface VirtualJoinColumnRelationship extends ReadOnlyJoinColumnRelationship, VirtualRelationship { - VirtualJoinColumnRelationshipStrategy getJoinColumnJoiningStrategy(); + VirtualJoinColumnRelationshipStrategy getJoinColumnStrategy(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/VirtualJoinTableRelationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/VirtualJoinTableRelationship.java index 938dc8fbae..1c5e481278 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/VirtualJoinTableRelationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/VirtualJoinTableRelationship.java @@ -22,5 +22,5 @@ public interface VirtualJoinTableRelationship extends ReadOnlyJoinTableRelationship, VirtualRelationship { - VirtualJoinTableRelationshipStrategy getJoinTableJoiningStrategy(); + VirtualJoinTableRelationshipStrategy getJoinTableStrategy(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/VirtualRelationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/VirtualRelationship.java index ab9ef22c50..5fdd104256 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/VirtualRelationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/VirtualRelationship.java @@ -21,7 +21,7 @@ package org.eclipse.jpt.core.context; public interface VirtualRelationship extends ReadOnlyRelationship { - VirtualRelationshipStrategy getPredominantJoiningStrategy(); + VirtualRelationshipStrategy getStrategy(); Relationship resolveOverriddenRelationship(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinColumnRelationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinColumnRelationship.java index 4d64fce30a..bb09232472 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinColumnRelationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinColumnRelationship.java @@ -26,5 +26,5 @@ import org.eclipse.jpt.core.context.JoinColumnRelationship; public interface JavaJoinColumnRelationship extends JoinColumnRelationship, JavaRelationship { - JavaJoinColumnRelationshipStrategy getJoinColumnJoiningStrategy(); + JavaJoinColumnRelationshipStrategy getJoinColumnStrategy(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinTableRelationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinTableRelationship.java index 7ae9f425fa..5d5910b9d9 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinTableRelationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaJoinTableRelationship.java @@ -26,5 +26,5 @@ import org.eclipse.jpt.core.context.JoinTableRelationship; public interface JavaJoinTableRelationship extends JoinTableRelationship, JavaRelationship { - JavaJoinTableRelationshipStrategy getJoinTableJoiningStrategy(); + JavaJoinTableRelationshipStrategy getJoinTableStrategy(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaMappedByRelationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaMappedByRelationship.java index fd5eddf32b..60730197e4 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaMappedByRelationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaMappedByRelationship.java @@ -27,7 +27,7 @@ import org.eclipse.jpt.core.resource.java.OwnableRelationshipMappingAnnotation; public interface JavaMappedByRelationship extends MappedByRelationship, JavaRelationship { - JavaMappedByRelationshipStrategy getMappedByJoiningStrategy(); + JavaMappedByRelationshipStrategy getMappedByStrategy(); OwnableRelationshipMappingAnnotation getMappingAnnotation(); diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPrimaryKeyJoinColumnRelationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPrimaryKeyJoinColumnRelationship.java index a7c8673be8..e22ebbf317 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPrimaryKeyJoinColumnRelationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaPrimaryKeyJoinColumnRelationship.java @@ -27,5 +27,5 @@ public interface JavaPrimaryKeyJoinColumnRelationship extends PrimaryKeyJoinColumnRelationship, JavaMappingRelationship { - JavaPrimaryKeyJoinColumnRelationshipStrategy getPrimaryKeyJoinColumnJoiningStrategy(); + JavaPrimaryKeyJoinColumnRelationshipStrategy getPrimaryKeyJoinColumnStrategy(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaReadOnlyRelationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaReadOnlyRelationship.java index b45017dfb9..f88adc67e3 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaReadOnlyRelationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaReadOnlyRelationship.java @@ -24,5 +24,5 @@ import org.eclipse.jpt.core.context.ReadOnlyRelationship; public interface JavaReadOnlyRelationship extends ReadOnlyRelationship, JavaJpaContextNode { - JavaReadOnlyRelationshipStrategy getPredominantJoiningStrategy(); + JavaReadOnlyRelationshipStrategy getStrategy(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaRelationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaRelationship.java index 38a7a7537e..37bd5738c8 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaRelationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaRelationship.java @@ -27,5 +27,5 @@ import org.eclipse.jpt.core.context.Relationship; public interface JavaRelationship extends Relationship, JavaReadOnlyRelationship { - JavaRelationshipStrategy getPredominantJoiningStrategy(); + JavaRelationshipStrategy getStrategy(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaVirtualJoinColumnRelationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaVirtualJoinColumnRelationship.java index 839aabfad0..b301be2111 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaVirtualJoinColumnRelationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaVirtualJoinColumnRelationship.java @@ -24,5 +24,5 @@ public interface JavaVirtualJoinColumnRelationship extends VirtualJoinColumnRelationship, JavaVirtualRelationship { - JavaVirtualJoinColumnRelationshipStrategy getJoinColumnJoiningStrategy(); + JavaVirtualJoinColumnRelationshipStrategy getJoinColumnStrategy(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaVirtualJoinTableRelationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaVirtualJoinTableRelationship.java index a23f10c738..1e6b4c9665 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaVirtualJoinTableRelationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaVirtualJoinTableRelationship.java @@ -24,5 +24,5 @@ public interface JavaVirtualJoinTableRelationship extends VirtualJoinTableRelationship, JavaVirtualRelationship { - JavaVirtualJoinTableRelationshipStrategy getJoinTableJoiningStrategy(); + JavaVirtualJoinTableRelationshipStrategy getJoinTableStrategy(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaVirtualRelationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaVirtualRelationship.java index 3b38dc57d3..0aca8c3332 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaVirtualRelationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaVirtualRelationship.java @@ -23,5 +23,5 @@ import org.eclipse.jpt.core.context.VirtualRelationship; public interface JavaVirtualRelationship extends VirtualRelationship, JavaReadOnlyRelationship { - JavaVirtualRelationshipStrategy getPredominantJoiningStrategy(); + JavaVirtualRelationshipStrategy getStrategy(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinColumnRelationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinColumnRelationship.java index 5f1ba497e6..662deb3c3f 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinColumnRelationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinColumnRelationship.java @@ -30,5 +30,5 @@ public interface OrmJoinColumnRelationship { XmlJoinColumnContainer getXmlContainer(); - OrmJoinColumnRelationshipStrategy getJoinColumnJoiningStrategy(); + OrmJoinColumnRelationshipStrategy getJoinColumnStrategy(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinTableRelationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinTableRelationship.java index 9e5977a608..203a576a50 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinTableRelationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmJoinTableRelationship.java @@ -29,5 +29,5 @@ public interface OrmJoinTableRelationship { XmlJoinTableContainer getXmlContainer(); - OrmJoinTableRelationshipStrategy getJoinTableJoiningStrategy(); + OrmJoinTableRelationshipStrategy getJoinTableStrategy(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMappedByRelationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMappedByRelationship.java index 8db4fa694d..ee595a9122 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMappedByRelationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmMappedByRelationship.java @@ -29,5 +29,5 @@ public interface OrmMappedByRelationship { XmlMappedByMapping getXmlContainer(); - OrmMappedByRelationshipStrategy getMappedByJoiningStrategy(); + OrmMappedByRelationshipStrategy getMappedByStrategy(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPrimaryKeyJoinColumnRelationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPrimaryKeyJoinColumnRelationship.java index 17af629ed7..c8cd0a6a63 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPrimaryKeyJoinColumnRelationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmPrimaryKeyJoinColumnRelationship.java @@ -29,5 +29,5 @@ public interface OrmPrimaryKeyJoinColumnRelationship { XmlPrimaryKeyJoinColumnContainer getXmlContainer(); - OrmPrimaryKeyJoinColumnRelationshipStrategy getPrimaryKeyJoinColumnJoiningStrategy(); + OrmPrimaryKeyJoinColumnRelationshipStrategy getPrimaryKeyJoinColumnStrategy(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmReadOnlyRelationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmReadOnlyRelationship.java index 9e04379132..f2f14ae640 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmReadOnlyRelationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmReadOnlyRelationship.java @@ -28,5 +28,5 @@ import org.eclipse.jpt.core.context.XmlContextNode; public interface OrmReadOnlyRelationship extends ReadOnlyRelationship, XmlContextNode { - OrmReadOnlyRelationshipStrategy getPredominantJoiningStrategy(); + OrmReadOnlyRelationshipStrategy getStrategy(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmRelationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmRelationship.java index 7a6b0e6505..b8f359e80a 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmRelationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmRelationship.java @@ -27,5 +27,5 @@ import org.eclipse.jpt.core.context.Relationship; public interface OrmRelationship extends Relationship, OrmReadOnlyRelationship { - OrmRelationshipStrategy getPredominantJoiningStrategy(); + OrmRelationshipStrategy getStrategy(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmVirtualJoinColumnRelationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmVirtualJoinColumnRelationship.java index aa9b542ecf..2c33552efd 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmVirtualJoinColumnRelationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmVirtualJoinColumnRelationship.java @@ -24,5 +24,5 @@ public interface OrmVirtualJoinColumnRelationship extends VirtualJoinColumnRelationship, OrmVirtualRelationship { - OrmVirtualJoinColumnRelationshipStrategy getJoinColumnJoiningStrategy(); + OrmVirtualJoinColumnRelationshipStrategy getJoinColumnStrategy(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmVirtualJoinTableRelationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmVirtualJoinTableRelationship.java index f8c7cdd20a..7b1ed451b5 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmVirtualJoinTableRelationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmVirtualJoinTableRelationship.java @@ -24,5 +24,5 @@ public interface OrmVirtualJoinTableRelationship extends VirtualJoinTableRelationship, OrmVirtualRelationship { - OrmVirtualJoinTableRelationshipStrategy getJoinTableJoiningStrategy(); + OrmVirtualJoinTableRelationshipStrategy getJoinTableStrategy(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmVirtualRelationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmVirtualRelationship.java index dab231e6a5..69c741e092 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmVirtualRelationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmVirtualRelationship.java @@ -23,5 +23,5 @@ import org.eclipse.jpt.core.context.VirtualRelationship; public interface OrmVirtualRelationship extends VirtualRelationship, OrmReadOnlyRelationship { - OrmVirtualRelationshipStrategy getPredominantJoiningStrategy(); + OrmVirtualRelationshipStrategy getStrategy(); } diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaMappingRelationship.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaMappingRelationship.java index fe0a31adfe..ed0a01d552 100644 --- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaMappingRelationship.java +++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaMappingRelationship.java @@ -50,14 +50,14 @@ public abstract class AbstractJavaMappingRelationship candidateTableNames() { @@ -711,8 +711,8 @@ public abstract class AbstractOrmMultiRelationshipMapping buildUsesJoinColumnJoiningStrategyHolder(PropertyValueModel subjectHolder) { return new PropertyAspectAdapter( - subjectHolder, ReadOnlyRelationship.PREDOMINANT_JOINING_STRATEGY_PROPERTY) { + subjectHolder, ReadOnlyRelationship.STRATEGY_PROPERTY) { @Override protected Boolean buildValue() { return Boolean.valueOf(this.buildBooleanValue()); } protected boolean buildBooleanValue() { - return (this.subject != null) && this.subject.usesJoinColumnJoiningStrategy(); + return (this.subject != null) && this.subject.strategyIsJoinColumn(); } @Override protected void setValue_(Boolean value) { if (value == Boolean.TRUE) { - ((JoinColumnRelationship) this.subject).setJoinColumnJoiningStrategy(); + ((JoinColumnRelationship) this.subject).setStrategyToJoinColumn(); } //value == FALSE - selection of another radio button causes this strategy to get unset } diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/JoinTableJoiningStrategyPane.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/JoinTableJoiningStrategyPane.java index a35b0ae27f..887de84a3f 100644 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/JoinTableJoiningStrategyPane.java +++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/JoinTableJoiningStrategyPane.java @@ -75,7 +75,7 @@ public class JoinTableJoiningStrategyPane getSubjectHolder()) { @Override protected ReadOnlyJoinTableRelationshipStrategy buildValue_() { - return this.subject.getJoinTableJoiningStrategy(); + return this.subject.getJoinTableStrategy(); } }; } @@ -92,20 +92,20 @@ public class JoinTableJoiningStrategyPane public static WritablePropertyValueModel buildUsesJoinTableJoiningStrategyHolder(PropertyValueModel subjectHolder) { return new PropertyAspectAdapter( - subjectHolder, ReadOnlyRelationship.PREDOMINANT_JOINING_STRATEGY_PROPERTY) { + subjectHolder, ReadOnlyRelationship.STRATEGY_PROPERTY) { @Override protected Boolean buildValue() { return Boolean.valueOf(this.buildBooleanValue()); } protected boolean buildBooleanValue() { - return (this.subject != null) && this.subject.usesJoinTableJoiningStrategy(); + return (this.subject != null) && this.subject.strategyIsJoinTable(); } @Override protected void setValue_(Boolean value) { if (value == Boolean.TRUE) { - ((JoinTableRelationship) this.subject).setJoinTableJoiningStrategy(); + ((JoinTableRelationship) this.subject).setStrategyToJoinTable(); } //value == FALSE - selection of another radio button causes this strategy to get unset } diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/ManyToManyJoiningStrategyPane.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/ManyToManyJoiningStrategyPane.java index 54ed647b33..29a5b7aef6 100644 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/ManyToManyJoiningStrategyPane.java +++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/ManyToManyJoiningStrategyPane.java @@ -87,17 +87,17 @@ public class ManyToManyJoiningStrategyPane protected WritablePropertyValueModel buildUsesMappedByStrategyHolder() { return new PropertyAspectAdapter( - this.getSubjectHolder(), ReadOnlyRelationship.PREDOMINANT_JOINING_STRATEGY_PROPERTY) { + this.getSubjectHolder(), ReadOnlyRelationship.STRATEGY_PROPERTY) { @Override protected Boolean buildValue() { return (this.subject == null) ? Boolean.FALSE : - Boolean.valueOf(this.subject.usesMappedByJoiningStrategy()); + Boolean.valueOf(this.subject.strategyIsMappedBy()); } @Override protected void setValue_(Boolean value) { if (value == Boolean.TRUE) { - this.subject.setMappedByJoiningStrategy(); + this.subject.setStrategyToMappedBy(); } //value == FALSE - selection of another radio button causes this strategy to get unset } @@ -106,17 +106,17 @@ public class ManyToManyJoiningStrategyPane protected WritablePropertyValueModel buildUsesJoinTableStrategyHolder() { return new PropertyAspectAdapter( - this.getSubjectHolder(), ReadOnlyRelationship.PREDOMINANT_JOINING_STRATEGY_PROPERTY) { + this.getSubjectHolder(), ReadOnlyRelationship.STRATEGY_PROPERTY) { @Override protected Boolean buildValue() { return (this.subject == null) ? Boolean.FALSE : - Boolean.valueOf(this.subject.usesJoinTableJoiningStrategy()); + Boolean.valueOf(this.subject.strategyIsJoinTable()); } @Override protected void setValue_(Boolean value) { if (value == Boolean.TRUE) { - this.subject.setJoinTableJoiningStrategy(); + this.subject.setStrategyToJoinTable(); } //value == FALSE - selection of another radio button causes this strategy to get unset } diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/MappedByJoiningStrategyPane.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/MappedByJoiningStrategyPane.java index 3a976097a2..db09686fde 100644 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/MappedByJoiningStrategyPane.java +++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/MappedByJoiningStrategyPane.java @@ -68,24 +68,24 @@ public class MappedByJoiningStrategyPane getSubjectHolder()) { @Override protected MappedByRelationshipStrategy buildValue_() { - return this.subject.getMappedByJoiningStrategy(); + return this.subject.getMappedByStrategy(); } }; } public static WritablePropertyValueModel buildUsesMappedByJoiningStrategyHolder(PropertyValueModel subjectHolder) { return new PropertyAspectAdapter( - subjectHolder, ReadOnlyRelationship.PREDOMINANT_JOINING_STRATEGY_PROPERTY) { + subjectHolder, ReadOnlyRelationship.STRATEGY_PROPERTY) { @Override protected Boolean buildValue() { return (this.subject == null) ? Boolean.FALSE : - Boolean.valueOf(this.subject.usesMappedByJoiningStrategy()); + Boolean.valueOf(this.subject.strategyIsMappedBy()); } @Override protected void setValue_(Boolean value) { if (value == Boolean.TRUE) { - this.subject.setMappedByJoiningStrategy(); + this.subject.setStrategyToMappedBy(); } //value == FALSE - selection of another radio button causes this strategy to get unset } diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PrimaryKeyJoinColumnJoiningStrategyPane.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PrimaryKeyJoinColumnJoiningStrategyPane.java index 1743194b4d..bba920981b 100644 --- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PrimaryKeyJoinColumnJoiningStrategyPane.java +++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/details/PrimaryKeyJoinColumnJoiningStrategyPane.java @@ -55,7 +55,7 @@ public class PrimaryKeyJoinColumnJoiningStrategyPane getSubjectHolder()) { @Override protected PrimaryKeyJoinColumnRelationshipStrategy buildValue_() { - return this.subject.getPrimaryKeyJoinColumnJoiningStrategy(); + return this.subject.getPrimaryKeyJoinColumnStrategy(); } }; } @@ -67,17 +67,17 @@ public class PrimaryKeyJoinColumnJoiningStrategyPane public static WritablePropertyValueModel buildUsesPrimaryKeyJoinColumnJoiningStrategyHolder(PropertyValueModel subjectHolder) { return new PropertyAspectAdapter( - subjectHolder, ReadOnlyRelationship.PREDOMINANT_JOINING_STRATEGY_PROPERTY) { + subjectHolder, ReadOnlyRelationship.STRATEGY_PROPERTY) { @Override protected Boolean buildValue() { return (this.subject == null) ? Boolean.FALSE : - Boolean.valueOf(this.subject.usesPrimaryKeyJoinColumnJoiningStrategy()); + Boolean.valueOf(this.subject.strategyIsPrimaryKeyJoinColumn()); } @Override protected void setValue_(Boolean value) { if (value == Boolean.TRUE) { - this.subject.setPrimaryKeyJoinColumnJoiningStrategy(); + this.subject.setStrategyToPrimaryKeyJoinColumn(); } //value == FALSE - selection of another radio button causes this strategy to get unset } diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaAssociationOverrideTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaAssociationOverrideTests.java index 9b82ee546a..49fb1e79d3 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaAssociationOverrideTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaAssociationOverrideTests.java @@ -178,7 +178,7 @@ public class JavaAssociationOverrideTests extends ContextModelTestCase JavaAssociationOverrideContainer overrideContainer = entity.getAssociationOverrideContainer(); JavaVirtualAssociationOverride virtualOverride = overrideContainer.virtualOverrides().next(); JavaAssociationOverride specifiedOverride = virtualOverride.convertToSpecified(); - JavaJoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnJoiningStrategy(); + JavaJoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnStrategy(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild"); AssociationOverrideAnnotation associationOverrideAnnotation = (AssociationOverrideAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDE); @@ -227,7 +227,7 @@ public class JavaAssociationOverrideTests extends ContextModelTestCase JavaAssociationOverrideContainer overrideContainer = entity.getAssociationOverrideContainer(); JavaVirtualAssociationOverride javaAssociationOverride = overrideContainer.virtualOverrides().next(); JavaAssociationOverride specifiedOverride = javaAssociationOverride.convertToSpecified(); - JavaJoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnJoiningStrategy(); + JavaJoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnStrategy(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild"); AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDE); @@ -266,7 +266,7 @@ public class JavaAssociationOverrideTests extends ContextModelTestCase JavaAssociationOverrideContainer overrideContainer = entity.getAssociationOverrideContainer(); JavaVirtualAssociationOverride javaAssociationOverride = overrideContainer.virtualOverrides().next(); JavaAssociationOverride specifiedOverride = javaAssociationOverride.convertToSpecified(); - JavaJoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnJoiningStrategy(); + JavaJoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnStrategy(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild"); AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDE); @@ -310,7 +310,7 @@ public class JavaAssociationOverrideTests extends ContextModelTestCase JavaAssociationOverrideContainer overrideContainer = entity.getAssociationOverrideContainer(); JavaVirtualAssociationOverride javaAssociationOverride = overrideContainer.virtualOverrides().next(); JavaAssociationOverride specifiedOverride = javaAssociationOverride.convertToSpecified(); - JavaJoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnJoiningStrategy(); + JavaJoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnStrategy(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild"); AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDE); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEntityTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEntityTests.java index 80d80394ed..c397ef34f4 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEntityTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaEntityTests.java @@ -2456,7 +2456,7 @@ public class JavaEntityTests extends ContextModelTestCase assertEquals(2, overrideContainer.virtualOverridesSize()); VirtualAssociationOverride virtualAssociationOverride = overrideContainer.virtualOverrides().next(); - ReadOnlyJoinColumnRelationshipStrategy joiningStrategy = ((ReadOnlyJoinColumnRelationship) virtualAssociationOverride.getRelationship()).getJoinColumnJoiningStrategy(); + ReadOnlyJoinColumnRelationshipStrategy joiningStrategy = ((ReadOnlyJoinColumnRelationship) virtualAssociationOverride.getRelationship()).getJoinColumnStrategy(); assertEquals("oneToOne", virtualAssociationOverride.getName()); assertEquals(1, joiningStrategy.joinColumnsSize()); ReadOnlyJoinColumn virtualJoinColumn = joiningStrategy.joinColumns().next(); @@ -2471,7 +2471,7 @@ public class JavaEntityTests extends ContextModelTestCase OneToOneMapping oneToOneMapping = (OneToOneMapping) getJavaPersistentType().getAttributeNamed("oneToOne").getMapping(); - JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy().addSpecifiedJoinColumn(0); + JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnStrategy().addSpecifiedJoinColumn(0); joinColumn.setSpecifiedName("MY_JOIN_COLUMN"); joinColumn.setSpecifiedReferencedColumnName("MY_REFERENCE_COLUMN"); joinColumn.setSpecifiedTable("BAR"); @@ -2487,7 +2487,7 @@ public class JavaEntityTests extends ContextModelTestCase assertEquals(2, overrideContainer.virtualOverridesSize()); virtualAssociationOverride = overrideContainer.virtualOverrides().next(); - joiningStrategy = ((ReadOnlyJoinColumnRelationship) virtualAssociationOverride.getRelationship()).getJoinColumnJoiningStrategy(); + joiningStrategy = ((ReadOnlyJoinColumnRelationship) virtualAssociationOverride.getRelationship()).getJoinColumnStrategy(); assertEquals("oneToOne", virtualAssociationOverride.getName()); assertEquals(1, joiningStrategy.joinColumnsSize()); virtualAssociationOverride = overrideContainer.virtualOverrides().next(); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaJoinColumnTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaJoinColumnTests.java index 0696c1f591..1c03f4c09a 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaJoinColumnTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaJoinColumnTests.java @@ -94,7 +94,7 @@ public class JavaJoinColumnTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping(); - JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); JavaResourcePersistentType resourceType = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute resourceAttribute = resourceType.persistableAttributes().next(); @@ -125,7 +125,7 @@ public class JavaJoinColumnTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping(); - JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); JavaResourcePersistentType resourceType = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute resourceAttribute = resourceType.persistableAttributes().next(); @@ -195,7 +195,7 @@ public class JavaJoinColumnTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping(); - JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -227,7 +227,7 @@ public class JavaJoinColumnTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping(); - JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -257,7 +257,7 @@ public class JavaJoinColumnTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping(); - JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -289,7 +289,7 @@ public class JavaJoinColumnTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping(); - JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -320,7 +320,7 @@ public class JavaJoinColumnTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping(); - JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -352,7 +352,7 @@ public class JavaJoinColumnTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping(); - JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -378,7 +378,7 @@ public class JavaJoinColumnTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping(); - JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -410,7 +410,7 @@ public class JavaJoinColumnTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping(); - JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -436,7 +436,7 @@ public class JavaJoinColumnTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping(); - JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -468,7 +468,7 @@ public class JavaJoinColumnTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping(); - JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -494,7 +494,7 @@ public class JavaJoinColumnTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping(); - JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -526,7 +526,7 @@ public class JavaJoinColumnTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping(); - JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaJoinTableTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaJoinTableTests.java index 2dedddcb76..53b7a6d961 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaJoinTableTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaJoinTableTests.java @@ -135,7 +135,7 @@ public class JavaJoinTableTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); - JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -176,7 +176,7 @@ public class JavaJoinTableTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); - JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -205,7 +205,7 @@ public class JavaJoinTableTests extends ContextModelTestCase JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); - JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); //joinTable default name is null because targetEntity is not in the persistence unit assertNull(joinTable.getDefaultName()); @@ -246,7 +246,7 @@ public class JavaJoinTableTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); - JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); JoinColumn joinColumn = joinTable.joinColumns().next(); JoinColumn inverseJoinColumn = joinTable.inverseJoinColumns().next(); @@ -311,7 +311,7 @@ public class JavaJoinTableTests extends ContextModelTestCase JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); - JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); JoinColumn joinColumn = joinTable.joinColumns().next(); JoinColumn inverseJoinColumn = joinTable.inverseJoinColumns().next(); @@ -375,7 +375,7 @@ public class JavaJoinTableTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); - JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -416,7 +416,7 @@ public class JavaJoinTableTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); - JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); JavaResourcePersistentType resourceType = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute resourceAttribute = resourceType.persistableAttributes().next(); @@ -444,7 +444,7 @@ public class JavaJoinTableTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); - JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -485,7 +485,7 @@ public class JavaJoinTableTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); - JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); JavaResourcePersistentType resourceType = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute resourceAttribute = resourceType.persistableAttributes().next(); @@ -513,7 +513,7 @@ public class JavaJoinTableTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); - JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -555,7 +555,7 @@ public class JavaJoinTableTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); - JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); JavaResourcePersistentType resourceType = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute resourceAttribute = resourceType.persistableAttributes().next(); @@ -585,7 +585,7 @@ public class JavaJoinTableTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); - JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -625,7 +625,7 @@ public class JavaJoinTableTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); - JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -686,7 +686,7 @@ public class JavaJoinTableTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); - JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); assertEquals(0, joinTable.specifiedJoinColumnsSize()); @@ -702,7 +702,7 @@ public class JavaJoinTableTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); - JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); assertEquals(1, joinTable.joinColumnsSize()); @@ -717,17 +717,17 @@ public class JavaJoinTableTests extends ContextModelTestCase assertEquals(1, joinTable.joinColumnsSize()); // default columns - assertNotNull(manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable()); + assertNotNull(manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable()); JavaResourcePersistentAttribute resAttribute = this.getJavaPersistentType().attributes().next().getResourcePersistentAttribute(); assertNotNull(resAttribute.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME)); - manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().removeStrategy(); + manyToManyMapping.getRelationship().getJoinTableStrategy().removeStrategy(); // default join table - assertNotNull(manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable()); + assertNotNull(manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable()); assertNull(resAttribute.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME)); //if non-owning side of the relationship then no default join table - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute("foo"); - assertNull(manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable()); + manyToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("foo"); + assertNull(manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable()); } public void testAddSpecifiedInverseJoinColumn() throws Exception { @@ -735,7 +735,7 @@ public class JavaJoinTableTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); - JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -777,7 +777,7 @@ public class JavaJoinTableTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); - JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -807,7 +807,7 @@ public class JavaJoinTableTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); - JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -847,7 +847,7 @@ public class JavaJoinTableTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); - JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -912,7 +912,7 @@ public class JavaJoinTableTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); - JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); assertEquals(0, joinTable.specifiedInverseJoinColumnsSize()); @@ -928,7 +928,7 @@ public class JavaJoinTableTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); - JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); assertEquals(1, joinTable.inverseJoinColumnsSize()); @@ -943,8 +943,8 @@ public class JavaJoinTableTests extends ContextModelTestCase assertEquals(1, joinTable.inverseJoinColumnsSize()); //if non-owning side of the relationship then no default join table - manyToManyMapping.getRelationship().setMappedByJoiningStrategy(); - assertNull(manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable()); + manyToManyMapping.getRelationship().setStrategyToMappedBy(); + assertNull(manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable()); } public void testUniqueConstraints() throws Exception { @@ -952,7 +952,7 @@ public class JavaJoinTableTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); - JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); ListIterator uniqueConstraints = joinTable.uniqueConstraints(); assertFalse(uniqueConstraints.hasNext()); @@ -976,7 +976,7 @@ public class JavaJoinTableTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); - JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); assertEquals(0, joinTable.uniqueConstraintsSize()); @@ -995,7 +995,7 @@ public class JavaJoinTableTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); - JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); joinTable.addUniqueConstraint(0).addColumnName(0, "FOO"); joinTable.addUniqueConstraint(0).addColumnName(0, "BAR"); joinTable.addUniqueConstraint(0).addColumnName(0, "BAZ"); @@ -1016,7 +1016,7 @@ public class JavaJoinTableTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); - JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); joinTable.addUniqueConstraint(0).addColumnName(0, "FOO"); joinTable.addUniqueConstraint(1).addColumnName(0, "BAR"); joinTable.addUniqueConstraint(0).addColumnName(0, "BAZ"); @@ -1037,7 +1037,7 @@ public class JavaJoinTableTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); - JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); joinTable.addUniqueConstraint(0).addColumnName(0, "FOO"); joinTable.addUniqueConstraint(1).addColumnName(0, "BAR"); joinTable.addUniqueConstraint(2).addColumnName(0, "BAZ"); @@ -1083,7 +1083,7 @@ public class JavaJoinTableTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); - JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); joinTable.addUniqueConstraint(0).addColumnName(0, "FOO"); joinTable.addUniqueConstraint(1).addColumnName(0, "BAR"); joinTable.addUniqueConstraint(2).addColumnName(0, "BAZ"); @@ -1124,7 +1124,7 @@ public class JavaJoinTableTests extends ContextModelTestCase addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME); JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().attributes().next().getMapping(); - JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) attributeResource.addAnnotation(JoinTableAnnotation.ANNOTATION_NAME); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaManyToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaManyToManyMappingTests.java index 598b26d1d6..02fbea965d 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaManyToManyMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaManyToManyMappingTests.java @@ -302,7 +302,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf"); - manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO"); + manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO"); assertFalse(manyToManyMapping.isDefault()); persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY); @@ -324,7 +324,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf"); - manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO"); + manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO"); assertFalse(manyToManyMapping.isDefault()); persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY); @@ -344,7 +344,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf"); - manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO"); + manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO"); assertFalse(manyToManyMapping.isDefault()); persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY); @@ -366,7 +366,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf"); - manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO"); + manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO"); assertFalse(manyToManyMapping.isDefault()); persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY); @@ -388,7 +388,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf"); - manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO"); + manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO"); assertFalse(manyToManyMapping.isDefault()); persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY); @@ -410,7 +410,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf"); - manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO"); + manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO"); assertFalse(manyToManyMapping.isDefault()); persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY); @@ -432,7 +432,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf"); - manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO"); + manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO"); assertFalse(manyToManyMapping.isDefault()); persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY); @@ -454,7 +454,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf"); - manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO"); + manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO"); assertFalse(manyToManyMapping.isDefault()); persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY); @@ -476,7 +476,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf"); - manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO"); + manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO"); assertFalse(manyToManyMapping.isDefault()); persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY); @@ -498,7 +498,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf"); - manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO"); + manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO"); assertFalse(manyToManyMapping.isDefault()); persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY); @@ -638,19 +638,19 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME); - assertNull(manyToManyMapping.getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + assertNull(manyToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute()); assertNull(manyToMany.getMappedBy()); //set mappedByJoiningStrategy in the resource model, verify context model updated manyToMany.setMappedBy("newMappedBy"); getJpaProject().synchronizeContextModel(); - assertEquals("newMappedBy", manyToManyMapping.getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + assertEquals("newMappedBy", manyToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute()); assertEquals("newMappedBy", manyToMany.getMappedBy()); //set mappedByJoiningStrategy to null in the resource model manyToMany.setMappedBy(null); getJpaProject().synchronizeContextModel(); - assertNull(manyToManyMapping.getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + assertNull(manyToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute()); assertNull(manyToMany.getMappedBy()); } @@ -665,17 +665,17 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) attributeResource.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME); - assertNull(manyToManyMapping.getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + assertNull(manyToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute()); assertNull(manyToMany.getMappedBy()); //set mappedBy in the context model, verify resource model updated - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute("newTargetEntity"); - assertEquals("newTargetEntity", manyToManyMapping.getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + manyToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("newTargetEntity"); + assertEquals("newTargetEntity", manyToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute()); assertEquals("newTargetEntity", manyToMany.getMappedBy()); //set mappedBy to null in the context model - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute(null); - assertNull(manyToManyMapping.getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + manyToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute(null); + assertNull(manyToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute()); assertNull(manyToMany.getMappedBy()); } @@ -691,20 +691,20 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); - rel.setMappedByJoiningStrategy(); + rel.setStrategyToMappedBy(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNotNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); - rel.setJoinTableJoiningStrategy(); + rel.setStrategyToJoinTable(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); } public void testUpdatePredominantJoiningStrategy() throws Exception { @@ -719,36 +719,36 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); annotation.setMappedBy("foo"); getJpaProject().synchronizeContextModel(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNotNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); resourceAttribute.addAnnotation(JPA.JOIN_TABLE); getJpaProject().synchronizeContextModel(); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNotNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); annotation.setMappedBy(null); getJpaProject().synchronizeContextModel(); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); resourceAttribute.removeAnnotation(JPA.JOIN_TABLE); getJpaProject().synchronizeContextModel(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); } public void testCandidateMappedByAttributeNames() throws Exception { @@ -763,7 +763,7 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); Iterator attributeNames = - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + manyToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -772,12 +772,12 @@ public class JavaManyToManyMappingTests extends ContextModelTestCase manyToManyMapping.setSpecifiedTargetEntity("foo"); attributeNames = - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + manyToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertFalse(attributeNames.hasNext()); manyToManyMapping.setSpecifiedTargetEntity(null); attributeNames = - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + manyToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaManyToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaManyToOneMappingTests.java index d1a52472da..a6e7fb7f51 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaManyToOneMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaManyToOneMappingTests.java @@ -181,7 +181,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy(); joinColumns.addSpecifiedJoinColumn(0); assertFalse(manyToOneMapping.isDefault()); @@ -202,7 +202,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy(); joinColumns.addSpecifiedJoinColumn(0); assertFalse(manyToOneMapping.isDefault()); @@ -221,7 +221,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy(); joinColumns.addSpecifiedJoinColumn(0); assertFalse(manyToOneMapping.isDefault()); @@ -242,7 +242,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy(); joinColumns.addSpecifiedJoinColumn(0); assertFalse(manyToOneMapping.isDefault()); @@ -263,7 +263,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy(); joinColumns.addSpecifiedJoinColumn(0); assertFalse(manyToOneMapping.isDefault()); @@ -284,7 +284,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy(); joinColumns.addSpecifiedJoinColumn(0); assertFalse(manyToOneMapping.isDefault()); @@ -305,7 +305,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy(); joinColumns.addSpecifiedJoinColumn(0); assertFalse(manyToOneMapping.isDefault()); @@ -326,7 +326,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy(); joinColumns.addSpecifiedJoinColumn(0); assertFalse(manyToOneMapping.isDefault()); @@ -347,7 +347,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy(); joinColumns.addSpecifiedJoinColumn(0); assertFalse(manyToOneMapping.isDefault()); @@ -368,7 +368,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy(); joinColumns.addSpecifiedJoinColumn(0); assertFalse(manyToOneMapping.isDefault()); @@ -504,7 +504,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy(); ListIterator specifiedJoinColumns = joinColumns.specifiedJoinColumns(); @@ -578,7 +578,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy(); assertEquals(0, joinColumns.specifiedJoinColumnsSize()); @@ -595,7 +595,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy(); assertEquals(1, joinColumns.joinColumnsSize()); @@ -616,7 +616,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy(); joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("FOO"); joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("BAR"); @@ -638,7 +638,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy(); joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("FOO"); joinColumns.addSpecifiedJoinColumn(1).setSpecifiedName("BAR"); @@ -659,7 +659,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy(); joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("FOO"); joinColumns.addSpecifiedJoinColumn(1).setSpecifiedName("BAR"); @@ -708,7 +708,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy(); joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("FOO"); joinColumns.addSpecifiedJoinColumn(1).setSpecifiedName("BAR"); @@ -749,7 +749,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy(); JavaResourcePersistentAttribute attributeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME).persistableAttributes().next(); ((JoinColumnAnnotation) attributeResource.addAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME)).setName("FOO"); @@ -803,7 +803,7 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy(); assertTrue(joinColumns.getDefaultJoinColumn().isDefault()); @@ -824,11 +824,11 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase ManyToOneRelationship rel = mapping.getRelationship(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); - assertTrue(rel.usesJoinColumnJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); - rel.setJoinColumnJoiningStrategy(); + rel.setStrategyToJoinColumn(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); - assertTrue(rel.usesJoinColumnJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); } public void testUpdatePredominantJoiningStrategy() throws Exception { @@ -841,17 +841,17 @@ public class JavaManyToOneMappingTests extends ContextModelTestCase ManyToOneRelationship rel = mapping.getRelationship(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); - assertTrue(rel.usesJoinColumnJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); resourceAttribute.addAnnotation(JPA.JOIN_COLUMN); getJpaProject().synchronizeContextModel(); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); - assertTrue(rel.usesJoinColumnJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); resourceAttribute.removeAnnotation(JPA.JOIN_COLUMN); getJpaProject().synchronizeContextModel(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); - assertTrue(rel.usesJoinColumnJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); } public void testDefaultTargetEntity() throws Exception { diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaOneToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaOneToManyMappingTests.java index a93d6147ed..cd2c1744d7 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaOneToManyMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaOneToManyMappingTests.java @@ -303,7 +303,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf"); - oneToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO"); + oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO"); assertFalse(oneToManyMapping.isDefault()); persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY); @@ -325,7 +325,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf"); - oneToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO"); + oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO"); assertFalse(oneToManyMapping.isDefault()); persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY); @@ -345,7 +345,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf"); - oneToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO"); + oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO"); assertFalse(oneToManyMapping.isDefault()); persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY); @@ -367,7 +367,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf"); - oneToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO"); + oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO"); assertFalse(oneToManyMapping.isDefault()); persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY); @@ -389,7 +389,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf"); - oneToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO"); + oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO"); assertFalse(oneToManyMapping.isDefault()); persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY); @@ -411,7 +411,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf"); - oneToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO"); + oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO"); assertFalse(oneToManyMapping.isDefault()); persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY); @@ -433,7 +433,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf"); - oneToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO"); + oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO"); assertFalse(oneToManyMapping.isDefault()); persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY); @@ -455,7 +455,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf"); - oneToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO"); + oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO"); assertFalse(oneToManyMapping.isDefault()); persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY); @@ -477,7 +477,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf"); - oneToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO"); + oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO"); assertFalse(oneToManyMapping.isDefault()); persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY); @@ -499,7 +499,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf"); - oneToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("FOO"); + oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO"); assertFalse(oneToManyMapping.isDefault()); persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY); @@ -640,19 +640,19 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME); - assertNull(oneToManyMapping.getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + assertNull(oneToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute()); assertNull(oneToMany.getMappedBy()); //set mappedBy in the resource model, verify context model updated oneToMany.setMappedBy("newMappedBy"); getJpaProject().synchronizeContextModel(); - assertEquals("newMappedBy", oneToManyMapping.getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + assertEquals("newMappedBy", oneToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute()); assertEquals("newMappedBy", oneToMany.getMappedBy()); //set mappedBy to null in the resource model oneToMany.setMappedBy(null); getJpaProject().synchronizeContextModel(); - assertNull(oneToManyMapping.getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + assertNull(oneToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute()); assertNull(oneToMany.getMappedBy()); } @@ -667,17 +667,17 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); OneToManyAnnotation oneToMany = (OneToManyAnnotation) attributeResource.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME); - assertNull(oneToManyMapping.getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + assertNull(oneToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute()); assertNull(oneToMany.getMappedBy()); //set mappedBy in the context model, verify resource model updated - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute("newTargetEntity"); - assertEquals("newTargetEntity", oneToManyMapping.getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("newTargetEntity"); + assertEquals("newTargetEntity", oneToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute()); assertEquals("newTargetEntity", oneToMany.getMappedBy()); //set mappedBy to null in the context model - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute(null); - assertNull(oneToManyMapping.getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute(null); + assertNull(oneToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute()); assertNull(oneToMany.getMappedBy()); } @@ -694,7 +694,7 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); Iterator attributeNames = - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -703,12 +703,12 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase oneToManyMapping.setSpecifiedTargetEntity("foo"); attributeNames = - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertFalse(attributeNames.hasNext()); oneToManyMapping.setSpecifiedTargetEntity(null); attributeNames = - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -733,20 +733,20 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); - rel.setMappedByJoiningStrategy(); + rel.setStrategyToMappedBy(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNotNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); - rel.setJoinTableJoiningStrategy(); + rel.setStrategyToJoinTable(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); } public void testUpdatePredominantJoiningStrategy() throws Exception { @@ -761,36 +761,36 @@ public class JavaOneToManyMappingTests extends ContextModelTestCase assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); annotation.setMappedBy("foo"); getJpaProject().synchronizeContextModel(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNotNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); resourceAttribute.addAnnotation(JPA.JOIN_TABLE); getJpaProject().synchronizeContextModel(); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNotNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); annotation.setMappedBy(null); getJpaProject().synchronizeContextModel(); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); resourceAttribute.removeAnnotation(JPA.JOIN_TABLE); getJpaProject().synchronizeContextModel(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); } public void testDefaultTargetEntity() throws Exception { diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaOneToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaOneToOneMappingTests.java index d6ff58966e..a13718cb5a 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaOneToOneMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/java/JavaOneToOneMappingTests.java @@ -217,7 +217,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); joinColumns.addSpecifiedJoinColumn(0); assertFalse(oneToOneMapping.isDefault()); @@ -238,7 +238,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); joinColumns.addSpecifiedJoinColumn(0); assertFalse(oneToOneMapping.isDefault()); @@ -257,7 +257,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); joinColumns.addSpecifiedJoinColumn(0); assertFalse(oneToOneMapping.isDefault()); @@ -278,7 +278,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); joinColumns.addSpecifiedJoinColumn(0); assertFalse(oneToOneMapping.isDefault()); @@ -299,7 +299,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); joinColumns.addSpecifiedJoinColumn(0); assertFalse(oneToOneMapping.isDefault()); @@ -320,7 +320,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); joinColumns.addSpecifiedJoinColumn(0); assertFalse(oneToOneMapping.isDefault()); @@ -341,7 +341,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); joinColumns.addSpecifiedJoinColumn(0); assertFalse(oneToOneMapping.isDefault()); @@ -362,7 +362,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); joinColumns.addSpecifiedJoinColumn(0); assertFalse(oneToOneMapping.isDefault()); @@ -383,7 +383,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); joinColumns.addSpecifiedJoinColumn(0); assertFalse(oneToOneMapping.isDefault()); @@ -404,7 +404,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); joinColumns.addSpecifiedJoinColumn(0); assertFalse(oneToOneMapping.isDefault()); @@ -478,7 +478,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - MappedByRelationshipStrategy mappedBy = oneToOneMapping.getRelationship().getMappedByJoiningStrategy(); + MappedByRelationshipStrategy mappedBy = oneToOneMapping.getRelationship().getMappedByStrategy(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -506,7 +506,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - MappedByRelationshipStrategy mappedBy = oneToOneMapping.getRelationship().getMappedByJoiningStrategy(); + MappedByRelationshipStrategy mappedBy = oneToOneMapping.getRelationship().getMappedByStrategy(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); @@ -656,7 +656,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); ListIterator specifiedJoinColumns = joinColumns.specifiedJoinColumns(); @@ -730,7 +730,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); assertEquals(0, joinColumns.specifiedJoinColumnsSize()); @@ -747,7 +747,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); assertEquals(1, joinColumns.joinColumnsSize()); @@ -762,7 +762,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase assertEquals(1, joinColumns.joinColumnsSize()); //if non-owning side of the relationship then no default join column - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute("foo"); + oneToOneMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("foo"); assertEquals(0, joinColumns.joinColumnsSize()); } @@ -772,7 +772,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("FOO"); joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("BAR"); @@ -795,7 +795,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("FOO"); joinColumns.addSpecifiedJoinColumn(1).setSpecifiedName("BAR"); @@ -817,7 +817,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("FOO"); joinColumns.addSpecifiedJoinColumn(1).setSpecifiedName("BAR"); @@ -866,7 +866,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("FOO"); joinColumns.addSpecifiedJoinColumn(1).setSpecifiedName("BAR"); @@ -908,7 +908,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); JavaResourcePersistentAttribute attributeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME).persistableAttributes().next(); ((JoinColumnAnnotation) attributeResource.addAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME, JoinColumnsAnnotation.ANNOTATION_NAME)).setName("FOO"); @@ -963,7 +963,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy(); assertTrue(joinColumns.getDefaultJoinColumn().isDefault()); @@ -986,7 +986,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); Iterator attributeNames = - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToOneMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -995,12 +995,12 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase oneToOneMapping.setSpecifiedTargetEntity("foo"); attributeNames = - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToOneMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertFalse(attributeNames.hasNext()); oneToOneMapping.setSpecifiedTargetEntity(null); attributeNames = - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToOneMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -1120,7 +1120,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); PrimaryKeyJoinColumnRelationshipStrategy strategy = - oneToOneMapping.getRelationship().getPrimaryKeyJoinColumnJoiningStrategy(); + oneToOneMapping.getRelationship().getPrimaryKeyJoinColumnStrategy(); Iterator primaryKeyJoinColumns = CollectionTools.iterable(strategy.primaryKeyJoinColumns()).iterator(); assertFalse(primaryKeyJoinColumns.hasNext()); @@ -1190,7 +1190,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); PrimaryKeyJoinColumnRelationshipStrategy strategy = - oneToOneMapping.getRelationship().getPrimaryKeyJoinColumnJoiningStrategy(); + oneToOneMapping.getRelationship().getPrimaryKeyJoinColumnStrategy(); assertEquals(0, strategy.primaryKeyJoinColumnsSize()); @@ -1208,7 +1208,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); PrimaryKeyJoinColumnRelationshipStrategy strategy = - oneToOneMapping.getRelationship().getPrimaryKeyJoinColumnJoiningStrategy(); + oneToOneMapping.getRelationship().getPrimaryKeyJoinColumnStrategy(); strategy.addPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); strategy.addPrimaryKeyJoinColumn(0).setSpecifiedName("BAR"); @@ -1231,7 +1231,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); PrimaryKeyJoinColumnRelationshipStrategy strategy = - oneToOneMapping.getRelationship().getPrimaryKeyJoinColumnJoiningStrategy(); + oneToOneMapping.getRelationship().getPrimaryKeyJoinColumnStrategy(); strategy.addPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); strategy.addPrimaryKeyJoinColumn(1).setSpecifiedName("BAR"); @@ -1254,7 +1254,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); PrimaryKeyJoinColumnRelationshipStrategy strategy = - oneToOneMapping.getRelationship().getPrimaryKeyJoinColumnJoiningStrategy(); + oneToOneMapping.getRelationship().getPrimaryKeyJoinColumnStrategy(); strategy.addPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); strategy.addPrimaryKeyJoinColumn(1).setSpecifiedName("BAR"); @@ -1304,7 +1304,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); PrimaryKeyJoinColumnRelationshipStrategy strategy = - oneToOneMapping.getRelationship().getPrimaryKeyJoinColumnJoiningStrategy(); + oneToOneMapping.getRelationship().getPrimaryKeyJoinColumnStrategy(); strategy.addPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); strategy.addPrimaryKeyJoinColumn(1).setSpecifiedName("BAR"); @@ -1348,7 +1348,7 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); PrimaryKeyJoinColumnRelationshipStrategy strategy = - oneToOneMapping.getRelationship().getPrimaryKeyJoinColumnJoiningStrategy(); + oneToOneMapping.getRelationship().getPrimaryKeyJoinColumnStrategy(); ((PrimaryKeyJoinColumnAnnotation) attributeResource.addAnnotation(0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME)).setName("FOO"); ((PrimaryKeyJoinColumnAnnotation) attributeResource.addAnnotation(1, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME, PrimaryKeyJoinColumnsAnnotation.ANNOTATION_NAME)).setName("BAR"); @@ -1409,33 +1409,33 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNull(annotation.getMappedBy()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); - rel.setPrimaryKeyJoinColumnJoiningStrategy(); + rel.setStrategyToPrimaryKeyJoinColumn(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNotNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); - rel.setMappedByJoiningStrategy(); + rel.setStrategyToMappedBy(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNotNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertTrue(rel.strategyIsMappedBy()); - rel.setJoinColumnJoiningStrategy(); + rel.setStrategyToJoinColumn(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNull(annotation.getMappedBy()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); } public void testUpdatePredominantJoiningStrategy() throws Exception { @@ -1451,62 +1451,62 @@ public class JavaOneToOneMappingTests extends ContextModelTestCase assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNull(annotation.getMappedBy()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); resourceAttribute.addAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN); getJpaProject().synchronizeContextModel(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNotNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); annotation.setMappedBy("foo"); getJpaProject().synchronizeContextModel(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNotNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNotNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertTrue(rel.strategyIsMappedBy()); resourceAttribute.addAnnotation(JPA.JOIN_COLUMN); getJpaProject().synchronizeContextModel(); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNotNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNotNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertTrue(rel.strategyIsMappedBy()); resourceAttribute.removeAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN); getJpaProject().synchronizeContextModel(); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNotNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertTrue(rel.strategyIsMappedBy()); annotation.setMappedBy(null); getJpaProject().synchronizeContextModel(); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNull(annotation.getMappedBy()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); resourceAttribute.removeAnnotation(JPA.JOIN_COLUMN); getJpaProject().synchronizeContextModel(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNull(annotation.getMappedBy()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); } } diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmAssociationOverrideTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmAssociationOverrideTests.java index 62a9975593..2048347390 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmAssociationOverrideTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmAssociationOverrideTests.java @@ -108,7 +108,7 @@ public class OrmAssociationOverrideTests extends ContextModelTestCase XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0); entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride()); OrmAssociationOverride ormAssociationOverride = overrideContainer.specifiedOverrides().next(); - OrmJoinColumnRelationshipStrategy joiningStrategy = ormAssociationOverride.getRelationship().getJoinColumnJoiningStrategy(); + OrmJoinColumnRelationshipStrategy joiningStrategy = ormAssociationOverride.getRelationship().getJoinColumnStrategy(); XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0); @@ -148,7 +148,7 @@ public class OrmAssociationOverrideTests extends ContextModelTestCase XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0); entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride()); OrmAssociationOverride ormAssociationOverride = overrideContainer.specifiedOverrides().next(); - OrmJoinColumnRelationshipStrategy joiningStrategy = ormAssociationOverride.getRelationship().getJoinColumnJoiningStrategy(); + OrmJoinColumnRelationshipStrategy joiningStrategy = ormAssociationOverride.getRelationship().getJoinColumnStrategy(); XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0); @@ -178,7 +178,7 @@ public class OrmAssociationOverrideTests extends ContextModelTestCase XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0); entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride()); OrmAssociationOverride ormAssociationOverride = overrideContainer.specifiedOverrides().next(); - OrmJoinColumnRelationshipStrategy joiningStrategy = ormAssociationOverride.getRelationship().getJoinColumnJoiningStrategy(); + OrmJoinColumnRelationshipStrategy joiningStrategy = ormAssociationOverride.getRelationship().getJoinColumnStrategy(); XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0); @@ -218,7 +218,7 @@ public class OrmAssociationOverrideTests extends ContextModelTestCase XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0); entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride()); OrmAssociationOverride ormAssociationOverride = overrideContainer.specifiedOverrides().next(); - OrmJoinColumnRelationshipStrategy joiningStrategy = ormAssociationOverride.getRelationship().getJoinColumnJoiningStrategy(); + OrmJoinColumnRelationshipStrategy joiningStrategy = ormAssociationOverride.getRelationship().getJoinColumnStrategy(); XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEntityTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEntityTests.java index 5d823dc357..342e175916 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEntityTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmEntityTests.java @@ -2089,7 +2089,7 @@ public class OrmEntityTests extends ContextModelTestCase assertEquals(2, overrideContainer.virtualOverridesSize()); ListIterator virtualOverrides = overrideContainer.virtualOverrides(); OrmVirtualAssociationOverride virtualOverride = virtualOverrides.next(); - OrmVirtualJoinColumnRelationshipStrategy joiningStrategy = ((OrmVirtualJoinColumnRelationship) virtualOverride.getRelationship()).getJoinColumnJoiningStrategy(); + OrmVirtualJoinColumnRelationshipStrategy joiningStrategy = ((OrmVirtualJoinColumnRelationship) virtualOverride.getRelationship()).getJoinColumnStrategy(); assertEquals("oneToOne", virtualOverride.getName()); assertEquals(1, joiningStrategy.joinColumnsSize()); @@ -2128,7 +2128,7 @@ public class OrmEntityTests extends ContextModelTestCase JavaAssociationOverride javaAssociationOverride = ormEntity.getJavaTypeMapping().getAssociationOverrideContainer().specifiedOverrides().next(); - JavaJoinColumnRelationshipStrategy javaJoiningStrategy = javaAssociationOverride.getRelationship().getJoinColumnJoiningStrategy(); + JavaJoinColumnRelationshipStrategy javaJoiningStrategy = javaAssociationOverride.getRelationship().getJoinColumnStrategy(); JavaJoinColumn javaJoinColumn = javaJoiningStrategy.joinColumns().next(); javaJoinColumn.setSpecifiedName("FOO"); javaJoinColumn.setSpecifiedReferencedColumnName("REFERENCE"); @@ -2142,7 +2142,7 @@ public class OrmEntityTests extends ContextModelTestCase assertEquals(2, overrideContainer.virtualOverridesSize()); virtualOverrides = overrideContainer.virtualOverrides(); virtualOverride = virtualOverrides.next(); - joiningStrategy = virtualOverride.getRelationship().getJoinColumnJoiningStrategy(); + joiningStrategy = virtualOverride.getRelationship().getJoinColumnStrategy(); assertEquals("oneToOne", virtualOverride.getName()); OrmVirtualJoinColumn ormJoinColumn = joiningStrategy.joinColumns().next(); assertEquals("FOO", ormJoinColumn.getSpecifiedName()); @@ -2155,13 +2155,13 @@ public class OrmEntityTests extends ContextModelTestCase assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedNullable()); virtualOverride = virtualOverrides.next(); - joiningStrategy = virtualOverride.getRelationship().getJoinColumnJoiningStrategy(); + joiningStrategy = virtualOverride.getRelationship().getJoinColumnStrategy(); assertEquals("manyToOne", virtualOverride.getName()); assertEquals(null, joiningStrategy.joinColumns().next().getSpecifiedName()); persistentType2.getAttributeNamed("manyToOne").convertToSpecified(); OrmManyToOneMapping manyToOneMapping = (OrmManyToOneMapping) persistentType2.getAttributeNamed("manyToOne").getMapping(); - OrmJoinColumn joinColumn = manyToOneMapping.getRelationship().getJoinColumnJoiningStrategy().addSpecifiedJoinColumn(0); + OrmJoinColumn joinColumn = manyToOneMapping.getRelationship().getJoinColumnStrategy().addSpecifiedJoinColumn(0); joinColumn.setSpecifiedName("MY_NAME"); joinColumn.setSpecifiedReferencedColumnName("MY_REFERNCE_NAME"); joinColumn.setSpecifiedTable("BAR2"); @@ -2175,7 +2175,7 @@ public class OrmEntityTests extends ContextModelTestCase assertEquals(2, overrideContainer.virtualOverridesSize()); virtualOverrides = overrideContainer.virtualOverrides(); virtualOverride = virtualOverrides.next(); - joiningStrategy = virtualOverride.getRelationship().getJoinColumnJoiningStrategy(); + joiningStrategy = virtualOverride.getRelationship().getJoinColumnStrategy(); assertEquals("manyToOne", virtualOverride.getName()); ormJoinColumn = joiningStrategy.joinColumns().next(); assertEquals("MY_NAME", ormJoinColumn.getSpecifiedName()); @@ -2188,7 +2188,7 @@ public class OrmEntityTests extends ContextModelTestCase assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedNullable()); virtualOverride = virtualOverrides.next(); - joiningStrategy = virtualOverride.getRelationship().getJoinColumnJoiningStrategy(); + joiningStrategy = virtualOverride.getRelationship().getJoinColumnStrategy(); assertEquals("oneToOne", virtualOverride.getName()); ormJoinColumn = joiningStrategy.joinColumns().next(); assertEquals("FOO", ormJoinColumn.getSpecifiedName()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmJoinColumnTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmJoinColumnTests.java index cb20d6f200..b8b85fd857 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmJoinColumnTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmJoinColumnTests.java @@ -45,7 +45,7 @@ public class OrmJoinColumnTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0); XmlJoinTable joinTableResource = manyToMany.getJoinTable(); XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0); @@ -78,7 +78,7 @@ public class OrmJoinColumnTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0); XmlJoinTable joinTableResource = manyToMany.getJoinTable(); XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0); @@ -103,7 +103,7 @@ public class OrmJoinColumnTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0); XmlJoinTable joinTableResource = manyToMany.getJoinTable(); XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0); @@ -136,7 +136,7 @@ public class OrmJoinColumnTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0); XmlJoinTable joinTableResource = manyToMany.getJoinTable(); XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0); @@ -161,7 +161,7 @@ public class OrmJoinColumnTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0); XmlJoinTable joinTableResource = manyToMany.getJoinTable(); XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0); @@ -194,7 +194,7 @@ public class OrmJoinColumnTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0); XmlJoinTable joinTableResource = manyToMany.getJoinTable(); XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0); @@ -219,7 +219,7 @@ public class OrmJoinColumnTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0); XmlJoinTable joinTableResource = manyToMany.getJoinTable(); XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0); @@ -252,7 +252,7 @@ public class OrmJoinColumnTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0); XmlJoinTable joinTableResource = manyToMany.getJoinTable(); XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0); @@ -277,7 +277,7 @@ public class OrmJoinColumnTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0); XmlJoinTable joinTableResource = manyToMany.getJoinTable(); XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0); @@ -310,7 +310,7 @@ public class OrmJoinColumnTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0); XmlJoinTable joinTableResource = manyToMany.getJoinTable(); XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0); @@ -335,7 +335,7 @@ public class OrmJoinColumnTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0); XmlJoinTable joinTableResource = manyToMany.getJoinTable(); XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0); @@ -368,7 +368,7 @@ public class OrmJoinColumnTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0); XmlJoinTable joinTableResource = manyToMany.getJoinTable(); XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0); @@ -393,7 +393,7 @@ public class OrmJoinColumnTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0); XmlJoinTable joinTableResource = manyToMany.getJoinTable(); XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0); @@ -426,7 +426,7 @@ public class OrmJoinColumnTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0); XmlJoinTable joinTableResource = manyToMany.getJoinTable(); XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0); @@ -451,7 +451,7 @@ public class OrmJoinColumnTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0); XmlJoinTable joinTableResource = manyToMany.getJoinTable(); XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0); @@ -484,7 +484,7 @@ public class OrmJoinColumnTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0); XmlJoinTable joinTableResource = manyToMany.getJoinTable(); XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmJoinTableTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmJoinTableTests.java index b821216d0b..d342b561f4 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmJoinTableTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmJoinTableTests.java @@ -143,7 +143,7 @@ public class OrmJoinTableTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); assertNull(ormJoinTable.getSpecifiedName()); assertNull(manyToMany.getJoinTable()); @@ -175,7 +175,7 @@ public class OrmJoinTableTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); assertNull(ormJoinTable.getSpecifiedName()); assertNull(manyToMany.getJoinTable()); @@ -198,7 +198,7 @@ public class OrmJoinTableTests extends ContextModelTestCase OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("projects"); ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping(); - JoinTable virtualJoinTable = virtualManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JoinTable virtualJoinTable = virtualManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); assertTrue(ormPersistentAttribute.isVirtual()); assertEquals(null, virtualJoinTable.getSpecifiedName()); @@ -221,7 +221,7 @@ public class OrmJoinTableTests extends ContextModelTestCase JavaPersistentAttribute javaPersistentAttribute = ormPersistentAttribute.getJavaPersistentAttribute(); JavaManyToManyMapping javaManyToManyMapping = (JavaManyToManyMapping) javaPersistentAttribute.getMapping(); - JavaJoinTable javaJoinTable = javaManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JavaJoinTable javaJoinTable = javaManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); javaJoinTable.setSpecifiedName("FOO"); javaJoinTable.setSpecifiedCatalog("CATALOG"); javaJoinTable.setSpecifiedSchema("SCHEMA"); @@ -253,7 +253,7 @@ public class OrmJoinTableTests extends ContextModelTestCase OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "projects"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); assertEquals(null, ormJoinTable.getDefaultName()); createTargetEntity(); @@ -269,7 +269,7 @@ public class OrmJoinTableTests extends ContextModelTestCase ormPersistentType.getJavaPersistentType().getAttributeNamed("projects").setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY); JavaManyToManyMapping javaManyMapping = (JavaManyToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("projects").getMapping(); - javaManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE"); + javaManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE"); assertEquals("BAR_FOO", ormJoinTable.getDefaultName()); @@ -286,12 +286,12 @@ public class OrmJoinTableTests extends ContextModelTestCase //ormPersistentType.getMapping().setSpecifiedMetadataComplete(null); OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("projects"); ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) ormPersistentAttribute2.getMapping(); - JoinTable virtualJoinTable = virtualManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JoinTable virtualJoinTable = virtualManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); assertTrue(ormPersistentAttribute2.isVirtual()); assertEquals("JAVA_JOIN_TABLE", virtualJoinTable.getSpecifiedName());//specifiedName since this is a virtual mapping now - javaManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName(null); - javaManyMapping.getRelationship().setJoinTableJoiningStrategy(); + javaManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName(null); + javaManyMapping.getRelationship().setStrategyToJoinTable(); assertNull(virtualJoinTable.getSpecifiedName()); assertEquals("BAR_FOO", virtualJoinTable.getDefaultName()); @@ -308,7 +308,7 @@ public class OrmJoinTableTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); assertNull(ormJoinTable.getSpecifiedSchema()); assertNull(manyToMany.getJoinTable()); @@ -426,7 +426,7 @@ public class OrmJoinTableTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); assertNull(ormJoinTable.getSpecifiedSchema()); assertNull(manyToMany.getJoinTable()); @@ -448,7 +448,7 @@ public class OrmJoinTableTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); assertNull(ormJoinTable.getSpecifiedCatalog()); assertNull(manyToMany.getJoinTable()); @@ -479,7 +479,7 @@ public class OrmJoinTableTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); assertNull(ormJoinTable.getSpecifiedCatalog()); assertNull(manyToMany.getJoinTable()); @@ -611,7 +611,7 @@ public class OrmJoinTableTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0); joinColumn.setSpecifiedName("FOO"); @@ -649,7 +649,7 @@ public class OrmJoinTableTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); ormJoinTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO"); ormJoinTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR"); @@ -677,7 +677,7 @@ public class OrmJoinTableTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); ormJoinTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO"); ormJoinTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR"); @@ -715,7 +715,7 @@ public class OrmJoinTableTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable()); XmlJoinTable joinTableResource = manyToMany.getJoinTable(); @@ -768,7 +768,7 @@ public class OrmJoinTableTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedInverseJoinColumn(0); joinColumn.setSpecifiedName("FOO"); @@ -806,7 +806,7 @@ public class OrmJoinTableTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); ormJoinTable.addSpecifiedInverseJoinColumn(0).setSpecifiedName("FOO"); ormJoinTable.addSpecifiedInverseJoinColumn(1).setSpecifiedName("BAR"); @@ -834,7 +834,7 @@ public class OrmJoinTableTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); ormJoinTable.addSpecifiedInverseJoinColumn(0).setSpecifiedName("FOO"); ormJoinTable.addSpecifiedInverseJoinColumn(1).setSpecifiedName("BAR"); @@ -872,7 +872,7 @@ public class OrmJoinTableTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable()); XmlJoinTable joinTableResource = manyToMany.getJoinTable(); @@ -926,7 +926,7 @@ public class OrmJoinTableTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable()); XmlJoinTable joinTableResource = manyToMany.getJoinTable(); @@ -954,7 +954,7 @@ public class OrmJoinTableTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable()); XmlJoinTable joinTableResource = manyToMany.getJoinTable(); @@ -977,7 +977,7 @@ public class OrmJoinTableTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable()); XmlJoinTable joinTableResource = manyToMany.getJoinTable(); @@ -999,7 +999,7 @@ public class OrmJoinTableTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable()); XmlJoinTable joinTableResource = manyToMany.getJoinTable(); @@ -1021,7 +1021,7 @@ public class OrmJoinTableTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable()); XmlJoinTable joinTableResource = manyToMany.getJoinTable(); @@ -1067,7 +1067,7 @@ public class OrmJoinTableTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable()); XmlJoinTable joinTableResource = manyToMany.getJoinTable(); @@ -1108,7 +1108,7 @@ public class OrmJoinTableTests extends ContextModelTestCase OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); - OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable()); XmlJoinTable joinTableResource = manyToMany.getJoinTable(); @@ -1168,7 +1168,7 @@ public class OrmJoinTableTests extends ContextModelTestCase OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME); ReadOnlyPersistentAttribute virtualAttribute = ormPersistentType.attributes().next(); ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) virtualAttribute.getMapping(); - JoinTable virtualJoinTable = virtualManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JoinTable virtualJoinTable = virtualManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); assertTrue(virtualAttribute.isVirtual()); @@ -1176,7 +1176,7 @@ public class OrmJoinTableTests extends ContextModelTestCase assertFalse(uniqueConstraints.hasNext()); JavaManyToManyMapping javaManyToManyMapping = (JavaManyToManyMapping) ormPersistentType.getJavaPersistentType().attributes().next().getMapping(); - JavaJoinTable javaJoinTable = javaManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JavaJoinTable javaJoinTable = javaManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); javaJoinTable.addUniqueConstraint(0).addColumnName(0, "FOO"); javaJoinTable.addUniqueConstraint(1).addColumnName(0, "BAR"); @@ -1190,7 +1190,7 @@ public class OrmJoinTableTests extends ContextModelTestCase assertFalse(uniqueConstraints.hasNext()); OrmManyToManyMapping specifiedManyToManyMapping = (OrmManyToManyMapping) ((VirtualOrmPersistentAttribute) virtualAttribute).convertToSpecified().getMapping(); - assertEquals(0, specifiedManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().uniqueConstraintsSize()); + assertEquals(0, specifiedManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().uniqueConstraintsSize()); } public void testDefaultName() throws Exception { @@ -1199,7 +1199,7 @@ public class OrmJoinTableTests extends ContextModelTestCase ormPersistentType.getAttributeNamed("projects").convertToSpecified(); OrmManyToManyMapping manyToManyMapping = (OrmManyToManyMapping) ormPersistentType.getAttributeNamed("projects").getMapping(); - JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); //joinTable default name is null because targetEntity is not in the persistence unit assertNull(joinTable.getDefaultName()); @@ -1240,7 +1240,7 @@ public class OrmJoinTableTests extends ContextModelTestCase ormPersistentType.getAttributeNamed("projects").convertToSpecified(); OrmManyToManyMapping manyToManyMapping = (OrmManyToManyMapping) ormPersistentType.getAttributeNamed("projects").getMapping(); - JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); JoinColumn joinColumn = joinTable.joinColumns().next(); JoinColumn inverseJoinColumn = joinTable.inverseJoinColumns().next(); @@ -1304,7 +1304,7 @@ public class OrmJoinTableTests extends ContextModelTestCase ormPersistentType.getAttributeNamed("projects").convertToSpecified(); OrmManyToManyMapping manyToManyMapping = (OrmManyToManyMapping) ormPersistentType.getAttributeNamed("projects").getMapping(); - JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable(); JoinColumn joinColumn = joinTable.joinColumns().next(); JoinColumn inverseJoinColumn = joinTable.inverseJoinColumns().next(); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmManyToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmManyToManyMappingTests.java index a0f4c909e1..050a27793f 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmManyToManyMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmManyToManyMappingTests.java @@ -389,7 +389,7 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - OrmMappedByRelationshipStrategy strategy = ormManyToManyMapping.getRelationship().getMappedByJoiningStrategy(); + OrmMappedByRelationshipStrategy strategy = ormManyToManyMapping.getRelationship().getMappedByStrategy(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); assertNull(strategy.getMappedByAttribute()); @@ -410,7 +410,7 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "manyToManyMapping"); OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping(); - OrmMappedByRelationshipStrategy strategy = ormManyToManyMapping.getRelationship().getMappedByJoiningStrategy(); + OrmMappedByRelationshipStrategy strategy = ormManyToManyMapping.getRelationship().getMappedByStrategy(); XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0); assertNull(strategy.getMappedByAttribute()); @@ -438,20 +438,20 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase assertNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); - rel.setMappedByJoiningStrategy(); + rel.setStrategyToMappedBy(); assertNull(resourceMapping.getJoinTable()); assertNotNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); - rel.setJoinTableJoiningStrategy(); + rel.setStrategyToJoinTable(); assertNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); } public void testUpdatePredominantJoiningStrategy() throws Exception { @@ -465,36 +465,36 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase assertNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); resourceMapping.setMappedBy("foo"); getJpaProject().synchronizeContextModel(); assertNull(resourceMapping.getJoinTable()); assertNotNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); resourceMapping.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable()); getJpaProject().synchronizeContextModel(); assertNotNull(resourceMapping.getJoinTable()); assertNotNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); resourceMapping.setMappedBy(null); getJpaProject().synchronizeContextModel(); assertNotNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); resourceMapping.setJoinTable(null); getJpaProject().synchronizeContextModel(); assertNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); } public void testUpdateMapKey() throws Exception { @@ -778,7 +778,7 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase manyToManyMapping.setSpecifiedTargetEntity("TargetEntity"); manyToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder"); manyToManyMapping.setSpecifiedMapKey("mapKey"); - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute("mappedBy"); + manyToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy"); manyToManyMapping.getCascade().setAll(true); manyToManyMapping.getCascade().setMerge(true); manyToManyMapping.getCascade().setPersist(true); @@ -793,7 +793,7 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase assertEquals("manyToMany", ormPersistentAttribute.getMapping().getName()); assertEquals(FetchType.EAGER, ((OneToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch()); assertEquals("TargetEntity", ((OneToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedTargetEntity()); - assertEquals("mappedBy", ((OneToOneMapping) ormPersistentAttribute.getMapping()).getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + assertEquals("mappedBy", ((OneToOneMapping) ormPersistentAttribute.getMapping()).getRelationship().getMappedByStrategy().getMappedByAttribute()); assertTrue(((OneToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isAll()); assertTrue(((OneToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isMerge()); assertTrue(((OneToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isPersist()); @@ -816,11 +816,11 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase manyToManyMapping.getCascade().setPersist(true); manyToManyMapping.getCascade().setRefresh(true); manyToManyMapping.getCascade().setRemove(true); - manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE"); - JoinColumn joinColumn = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().addSpecifiedJoinColumn(0); + manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE"); + JoinColumn joinColumn = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().addSpecifiedJoinColumn(0); joinColumn.setSpecifiedName("name"); joinColumn.setSpecifiedReferencedColumnName("referenceName"); - JoinColumn inverseJoinColumn = manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().addSpecifiedInverseJoinColumn(0); + JoinColumn inverseJoinColumn = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().addSpecifiedInverseJoinColumn(0); inverseJoinColumn.setSpecifiedName("inverseName"); inverseJoinColumn.setSpecifiedReferencedColumnName("inverseReferenceName"); assertFalse(manyToManyMapping.isDefault()); @@ -837,7 +837,7 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isPersist()); assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isRefresh()); assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isRemove()); - JoinTable joinTable = ((OneToManyMapping) ormPersistentAttribute.getMapping()).getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JoinTable joinTable = ((OneToManyMapping) ormPersistentAttribute.getMapping()).getRelationship().getJoinTableStrategy().getJoinTable(); assertEquals("MY_JOIN_TABLE", joinTable.getName()); assertEquals("name", joinTable.joinColumns().next().getSpecifiedName()); assertEquals("referenceName", joinTable.joinColumns().next().getSpecifiedReferencedColumnName()); @@ -918,7 +918,7 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); Iterator attributeNames = - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + manyToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -927,12 +927,12 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase manyToManyMapping.setSpecifiedTargetEntity("foo"); attributeNames = - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + manyToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertFalse(attributeNames.hasNext()); manyToManyMapping.setSpecifiedTargetEntity(null); attributeNames = - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + manyToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -1017,7 +1017,7 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase assertEquals(FetchType.EAGER, virtualManyToManyMapping.getSpecifiedFetch()); assertEquals("Address", virtualManyToManyMapping.getSpecifiedTargetEntity()); assertNull(virtualManyToManyMapping.getRelationship(). - getMappedByJoiningStrategy().getMappedByAttribute()); + getMappedByStrategy().getMappedByAttribute()); Cascade cascade = virtualManyToManyMapping.getCascade(); assertTrue(cascade.isAll()); @@ -1050,7 +1050,7 @@ public class OrmManyToManyMappingTests extends ContextModelTestCase assertEquals("address", ormManyToManyMapping.getName()); assertEquals(FetchType.LAZY, ormManyToManyMapping.getFetch()); assertEquals("test.Address", ormManyToManyMapping.getTargetEntity()); - assertNull(ormManyToManyMapping.getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + assertNull(ormManyToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute()); Cascade cascade = ormManyToManyMapping.getCascade(); assertFalse(cascade.isAll()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmManyToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmManyToOneMappingTests.java index 29a7928de4..19e9b73b46 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmManyToOneMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmManyToOneMappingTests.java @@ -312,7 +312,7 @@ public class OrmManyToOneMappingTests extends ContextModelTestCase OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "manyToOneMapping"); OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping(); - OrmJoinColumnRelationshipStrategy strategy = ormManyToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + OrmJoinColumnRelationshipStrategy strategy = ormManyToOneMapping.getRelationship().getJoinColumnStrategy(); XmlManyToOne manyToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0); OrmJoinColumn joinColumn = strategy.addSpecifiedJoinColumn(0); @@ -348,7 +348,7 @@ public class OrmManyToOneMappingTests extends ContextModelTestCase OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "manyToOneMapping"); OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping(); - OrmJoinColumnRelationshipStrategy strategy = ormManyToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + OrmJoinColumnRelationshipStrategy strategy = ormManyToOneMapping.getRelationship().getJoinColumnStrategy(); XmlManyToOne manyToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0); strategy.addSpecifiedJoinColumn(0).setSpecifiedName("FOO"); @@ -380,11 +380,11 @@ public class OrmManyToOneMappingTests extends ContextModelTestCase XmlManyToOne resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0); assertTrue(resourceMapping.getJoinColumns().isEmpty()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); - rel.setJoinColumnJoiningStrategy(); + rel.setStrategyToJoinColumn(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); } public void testUpdatePredominantJoiningStrategy() throws Exception { @@ -397,24 +397,24 @@ public class OrmManyToOneMappingTests extends ContextModelTestCase XmlManyToOne resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0); assertTrue(resourceMapping.getJoinColumns().isEmpty()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); resourceMapping.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn()); getJpaProject().synchronizeContextModel(); assertFalse(resourceMapping.getJoinColumns().isEmpty()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); resourceMapping.getJoinColumns().clear(); getJpaProject().synchronizeContextModel(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); } public void testMoveSpecifiedJoinColumn() throws Exception { OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "manyToOneMapping"); OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping(); - OrmJoinColumnRelationshipStrategy strategy = ormManyToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + OrmJoinColumnRelationshipStrategy strategy = ormManyToOneMapping.getRelationship().getJoinColumnStrategy(); XmlManyToOne manyToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0); strategy.addSpecifiedJoinColumn(0).setSpecifiedName("FOO"); @@ -458,7 +458,7 @@ public class OrmManyToOneMappingTests extends ContextModelTestCase OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.specifiedAttributes().next(); OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping(); - OrmJoinColumnRelationshipStrategy strategy = ormManyToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + OrmJoinColumnRelationshipStrategy strategy = ormManyToOneMapping.getRelationship().getJoinColumnStrategy(); assertEquals("foo", ormManyToOneMapping.getName()); @@ -498,7 +498,7 @@ public class OrmManyToOneMappingTests extends ContextModelTestCase assertEquals(Boolean.FALSE, manyToOneMapping.getSpecifiedOptional()); assertEquals("Address", manyToOneMapping.getSpecifiedTargetEntity()); - JoinColumn joinColumn = manyToOneMapping.getRelationship().getJoinColumnJoiningStrategy().specifiedJoinColumns().next(); + JoinColumn joinColumn = manyToOneMapping.getRelationship().getJoinColumnStrategy().specifiedJoinColumns().next(); assertEquals("MY_COLUMN", joinColumn.getSpecifiedName()); assertEquals("MY_REFERENCED_COLUMN", joinColumn.getSpecifiedReferencedColumnName()); assertEquals(Boolean.TRUE, joinColumn.getSpecifiedUnique()); @@ -580,7 +580,7 @@ public class OrmManyToOneMappingTests extends ContextModelTestCase assertEquals(true, ormManyToOneMapping.isOptional()); assertEquals("test.Address", ormManyToOneMapping.getDefaultTargetEntity()); - assertFalse(ormManyToOneMapping.getRelationship().getJoinColumnJoiningStrategy().specifiedJoinColumns().hasNext()); + assertFalse(ormManyToOneMapping.getRelationship().getJoinColumnStrategy().specifiedJoinColumns().hasNext()); //TODO default join columns for specified xmlManyToOne mapping // XmlJoinColumn ormJoinColumn = ormManyToOneMapping.defaultJoinColumns().next(); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmOneToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmOneToManyMappingTests.java index 1f96dd629d..e90bbedf9d 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmOneToManyMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmOneToManyMappingTests.java @@ -364,7 +364,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping"); OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping(); - OrmMappedByRelationshipStrategy strategy = ormOneToManyMapping.getRelationship().getMappedByJoiningStrategy(); + OrmMappedByRelationshipStrategy strategy = ormOneToManyMapping.getRelationship().getMappedByStrategy(); XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0); assertNull(strategy.getMappedByAttribute()); @@ -385,7 +385,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "oneToManyMapping"); OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping(); - OrmMappedByRelationshipStrategy strategy = ormOneToManyMapping.getRelationship().getMappedByJoiningStrategy(); + OrmMappedByRelationshipStrategy strategy = ormOneToManyMapping.getRelationship().getMappedByStrategy(); XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0); assertNull(strategy.getMappedByAttribute()); @@ -413,20 +413,20 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase assertNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); - rel.setMappedByJoiningStrategy(); + rel.setStrategyToMappedBy(); assertNull(resourceMapping.getJoinTable()); assertNotNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); - rel.setJoinTableJoiningStrategy(); + rel.setStrategyToJoinTable(); assertNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); } public void testUpdatePredominantJoiningStrategy() throws Exception { @@ -440,36 +440,36 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase assertNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); resourceMapping.setMappedBy("foo"); getJpaProject().synchronizeContextModel(); assertNull(resourceMapping.getJoinTable()); assertNotNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); resourceMapping.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable()); getJpaProject().synchronizeContextModel(); assertNotNull(resourceMapping.getJoinTable()); assertNotNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); resourceMapping.setMappedBy(null); getJpaProject().synchronizeContextModel(); assertNotNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); resourceMapping.setJoinTable(null); getJpaProject().synchronizeContextModel(); assertNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); } public void testUpdateMapKey() throws Exception { @@ -658,7 +658,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase oneToManyMapping.setSpecifiedTargetEntity("TargetEntity"); oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder"); oneToManyMapping.setSpecifiedMapKey("mapKey"); - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute("mappedBy"); + oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy"); assertFalse(oneToManyMapping.isDefault()); ormPersistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY); @@ -678,11 +678,11 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase oneToManyMapping.setSpecifiedTargetEntity("TargetEntity"); oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder"); oneToManyMapping.setSpecifiedMapKey("mapKey"); - oneToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE"); - JoinColumn joinColumn = oneToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().addSpecifiedJoinColumn(0); + oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE"); + JoinColumn joinColumn = oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().addSpecifiedJoinColumn(0); joinColumn.setSpecifiedName("name"); joinColumn.setSpecifiedReferencedColumnName("referenceName"); - JoinColumn inverseJoinColumn = oneToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().addSpecifiedInverseJoinColumn(0); + JoinColumn inverseJoinColumn = oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().addSpecifiedInverseJoinColumn(0); inverseJoinColumn.setSpecifiedName("inverseName"); inverseJoinColumn.setSpecifiedReferencedColumnName("inverseReferenceName"); assertFalse(oneToManyMapping.isDefault()); @@ -704,7 +704,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase oneToManyMapping.setSpecifiedTargetEntity("TargetEntity"); oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder"); oneToManyMapping.setSpecifiedMapKey("mapKey"); - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute("mappedBy"); + oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy"); assertFalse(oneToManyMapping.isDefault()); ormPersistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY); @@ -724,11 +724,11 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase oneToManyMapping.setSpecifiedTargetEntity("TargetEntity"); oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder"); oneToManyMapping.setSpecifiedMapKey("mapKey"); - oneToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE"); - JoinColumn joinColumn = oneToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().addSpecifiedJoinColumn(0); + oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE"); + JoinColumn joinColumn = oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().addSpecifiedJoinColumn(0); joinColumn.setSpecifiedName("name"); joinColumn.setSpecifiedReferencedColumnName("referenceName"); - JoinColumn inverseJoinColumn = oneToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().addSpecifiedInverseJoinColumn(0); + JoinColumn inverseJoinColumn = oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().addSpecifiedInverseJoinColumn(0); inverseJoinColumn.setSpecifiedName("inverseName"); inverseJoinColumn.setSpecifiedReferencedColumnName("inverseReferenceName"); assertFalse(oneToManyMapping.isDefault()); @@ -750,7 +750,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase oneToManyMapping.setSpecifiedTargetEntity("TargetEntity"); oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder"); oneToManyMapping.setSpecifiedMapKey("mapKey"); - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute("mappedBy"); + oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy"); assertFalse(oneToManyMapping.isDefault()); ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY); @@ -770,7 +770,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase oneToManyMapping.setSpecifiedTargetEntity("TargetEntity"); oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder"); oneToManyMapping.setSpecifiedMapKey("mapKey"); - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute("mappedBy"); + oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy"); oneToManyMapping.getCascade().setAll(true); oneToManyMapping.getCascade().setMerge(true); oneToManyMapping.getCascade().setPersist(true); @@ -785,7 +785,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase assertEquals("oneToMany", ormPersistentAttribute.getMapping().getName()); assertEquals(FetchType.EAGER, ((OneToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch()); assertEquals("TargetEntity", ((OneToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedTargetEntity()); - assertEquals("mappedBy", ((OneToOneMapping) ormPersistentAttribute.getMapping()).getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + assertEquals("mappedBy", ((OneToOneMapping) ormPersistentAttribute.getMapping()).getRelationship().getMappedByStrategy().getMappedByAttribute()); assertTrue(((OneToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isAll()); assertTrue(((OneToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isMerge()); assertTrue(((OneToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isPersist()); @@ -808,11 +808,11 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase oneToManyMapping.getCascade().setPersist(true); oneToManyMapping.getCascade().setRefresh(true); oneToManyMapping.getCascade().setRemove(true); - oneToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE"); - JoinColumn joinColumn = oneToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().addSpecifiedJoinColumn(0); + oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE"); + JoinColumn joinColumn = oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().addSpecifiedJoinColumn(0); joinColumn.setSpecifiedName("name"); joinColumn.setSpecifiedReferencedColumnName("referenceName"); - JoinColumn inverseJoinColumn = oneToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().addSpecifiedInverseJoinColumn(0); + JoinColumn inverseJoinColumn = oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().addSpecifiedInverseJoinColumn(0); inverseJoinColumn.setSpecifiedName("inverseName"); inverseJoinColumn.setSpecifiedReferencedColumnName("inverseReferenceName"); assertFalse(oneToManyMapping.isDefault()); @@ -829,7 +829,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isPersist()); assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isRefresh()); assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isRemove()); - JoinTable joinTable = ((ManyToManyMapping) ormPersistentAttribute.getMapping()).getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JoinTable joinTable = ((ManyToManyMapping) ormPersistentAttribute.getMapping()).getRelationship().getJoinTableStrategy().getJoinTable(); assertEquals("MY_JOIN_TABLE", joinTable.getName()); assertEquals("name", joinTable.joinColumns().next().getSpecifiedName()); assertEquals("referenceName", joinTable.joinColumns().next().getSpecifiedReferencedColumnName()); @@ -847,7 +847,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase oneToManyMapping.setSpecifiedTargetEntity("TargetEntity"); oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder"); oneToManyMapping.setSpecifiedMapKey("mapKey"); - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute("mappedBy"); + oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy"); oneToManyMapping.getCascade().setAll(true); oneToManyMapping.getCascade().setMerge(true); oneToManyMapping.getCascade().setPersist(true); @@ -879,7 +879,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase oneToManyMapping.setSpecifiedTargetEntity("TargetEntity"); oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder"); oneToManyMapping.setSpecifiedMapKey("mapKey"); - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute("mappedBy"); + oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy"); oneToManyMapping.getCascade().setAll(true); oneToManyMapping.getCascade().setMerge(true); oneToManyMapping.getCascade().setPersist(true); @@ -912,7 +912,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); Iterator attributeNames = - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -921,12 +921,12 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase oneToManyMapping.setSpecifiedTargetEntity("foo"); attributeNames = - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertFalse(attributeNames.hasNext()); oneToManyMapping.setSpecifiedTargetEntity(null); attributeNames = - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -1011,7 +1011,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase assertEquals(FetchType.EAGER, virtualOneToManyMapping.getSpecifiedFetch()); assertEquals("Address", virtualOneToManyMapping.getSpecifiedTargetEntity()); assertNull(virtualOneToManyMapping.getRelationship(). - getMappedByJoiningStrategy().getMappedByAttribute()); + getMappedByStrategy().getMappedByAttribute()); Cascade cascade = virtualOneToManyMapping.getCascade(); assertTrue(cascade.isAll()); @@ -1043,7 +1043,7 @@ public class OrmOneToManyMappingTests extends ContextModelTestCase assertEquals("address", ormOneToManyMapping.getName()); assertEquals(FetchType.LAZY, ormOneToManyMapping.getFetch()); assertEquals("test.Address", ormOneToManyMapping.getTargetEntity()); - assertNull(ormOneToManyMapping.getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + assertNull(ormOneToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute()); Cascade cascade = ormOneToManyMapping.getCascade(); assertFalse(cascade.isAll()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmOneToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmOneToOneMappingTests.java index 64f2bef718..b05969fe4a 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmOneToOneMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/context/orm/OrmOneToOneMappingTests.java @@ -323,7 +323,7 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - MappedByRelationshipStrategy strategy = ormOneToOneMapping.getRelationship().getMappedByJoiningStrategy(); + MappedByRelationshipStrategy strategy = ormOneToOneMapping.getRelationship().getMappedByStrategy(); XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); assertNull(strategy.getMappedByAttribute()); @@ -344,7 +344,7 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - MappedByRelationshipStrategy strategy = ormOneToOneMapping.getRelationship().getMappedByJoiningStrategy(); + MappedByRelationshipStrategy strategy = ormOneToOneMapping.getRelationship().getMappedByStrategy(); XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); assertNull(strategy.getMappedByAttribute()); @@ -373,33 +373,33 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNull(resourceMapping.getMappedBy()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); - rel.setMappedByJoiningStrategy(); + rel.setStrategyToMappedBy(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNotNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertTrue(rel.strategyIsMappedBy()); - rel.setPrimaryKeyJoinColumnJoiningStrategy(); + rel.setStrategyToPrimaryKeyJoinColumn(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); - rel.setJoinColumnJoiningStrategy(); + rel.setStrategyToJoinColumn(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNull(resourceMapping.getMappedBy()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); } public void testUpdatePredominantJoiningStrategy() throws Exception { @@ -414,63 +414,63 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNull(resourceMapping.getMappedBy()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); resourceMapping.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumn()); getJpaProject().synchronizeContextModel(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); resourceMapping.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn()); getJpaProject().synchronizeContextModel(); assertFalse(resourceMapping.getJoinColumns().isEmpty()); assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); resourceMapping.setMappedBy("foo"); getJpaProject().synchronizeContextModel(); assertFalse(resourceMapping.getJoinColumns().isEmpty()); assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNotNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertTrue(rel.strategyIsMappedBy()); resourceMapping.getPrimaryKeyJoinColumns().clear(); getJpaProject().synchronizeContextModel(); assertFalse(resourceMapping.getJoinColumns().isEmpty()); assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNotNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertTrue(rel.strategyIsMappedBy()); resourceMapping.getJoinColumns().clear(); getJpaProject().synchronizeContextModel(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNotNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertTrue(rel.strategyIsMappedBy()); resourceMapping.setMappedBy(null); getJpaProject().synchronizeContextModel(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNull(resourceMapping.getMappedBy()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); } public void testUpdateSpecifiedOptional() throws Exception { @@ -525,7 +525,7 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - OrmJoinColumnRelationshipStrategy strategy = ormOneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + OrmJoinColumnRelationshipStrategy strategy = ormOneToOneMapping.getRelationship().getJoinColumnStrategy(); XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); OrmJoinColumn joinColumn = strategy.addSpecifiedJoinColumn(0); @@ -561,7 +561,7 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - OrmJoinColumnRelationshipStrategy strategy = ormOneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + OrmJoinColumnRelationshipStrategy strategy = ormOneToOneMapping.getRelationship().getJoinColumnStrategy(); XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); strategy.addSpecifiedJoinColumn(0).setSpecifiedName("FOO"); @@ -587,7 +587,7 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - OrmJoinColumnRelationshipStrategy strategy = ormOneToOneMapping.getRelationship().getJoinColumnJoiningStrategy(); + OrmJoinColumnRelationshipStrategy strategy = ormOneToOneMapping.getRelationship().getJoinColumnStrategy(); XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); strategy.addSpecifiedJoinColumn(0).setSpecifiedName("FOO"); @@ -641,7 +641,7 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase assertNull(ormOneToOneMapping.getTargetEntity()); - assertTrue(ormOneToOneMapping.getRelationship().getJoinColumnJoiningStrategy().joinColumnsSize() > 0); + assertTrue(ormOneToOneMapping.getRelationship().getJoinColumnStrategy().joinColumnsSize() > 0); //TODO default joinColumns //assertTrue(ormOneToOneMapping.defaultJoinColumns().hasNext()); @@ -670,10 +670,10 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase assertEquals(Boolean.FALSE, oneToOneMapping.getSpecifiedOptional()); assertEquals("Address", oneToOneMapping.getSpecifiedTargetEntity()); assertNull(oneToOneMapping.getRelationship(). - getMappedByJoiningStrategy().getMappedByAttribute()); + getMappedByStrategy().getMappedByAttribute()); JoinColumn joinColumn = - oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy().specifiedJoinColumns().next(); + oneToOneMapping.getRelationship().getJoinColumnStrategy().specifiedJoinColumns().next(); assertEquals("MY_COLUMN", joinColumn.getSpecifiedName()); assertEquals("MY_REFERENCED_COLUMN", joinColumn.getSpecifiedReferencedColumnName()); assertEquals(Boolean.TRUE, joinColumn.getSpecifiedUnique()); @@ -712,7 +712,7 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase assertEquals(FetchType.EAGER, ormOneToOneMapping.getFetch()); assertEquals(true, ormOneToOneMapping.isOptional()); assertEquals("test.Address", ormOneToOneMapping.getTargetEntity()); - assertNull(ormOneToOneMapping.getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + assertNull(ormOneToOneMapping.getRelationship().getMappedByStrategy().getMappedByAttribute()); //TODO default join columns in xml one-to-one // XmlJoinColumn ormJoinColumn = ormOneToOneMapping.specifiedJoinColumns().next(); @@ -751,13 +751,13 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase assertNull(ormOneToOneMapping.getSpecifiedFetch()); assertNull(ormOneToOneMapping.getSpecifiedOptional()); assertNull(ormOneToOneMapping.getSpecifiedTargetEntity()); - assertNull(ormOneToOneMapping.getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + assertNull(ormOneToOneMapping.getRelationship().getMappedByStrategy().getMappedByAttribute()); assertEquals(FetchType.EAGER, ormOneToOneMapping.getFetch()); assertEquals(true, ormOneToOneMapping.isOptional()); //TODO default target entity in xml //assertEquals("test.Address", ormOneToOneMapping.getDefaultTargetEntity()); - assertTrue(ormOneToOneMapping.getRelationship().getJoinColumnJoiningStrategy().joinColumnsSize() > 0); + assertTrue(ormOneToOneMapping.getRelationship().getJoinColumnStrategy().joinColumnsSize() > 0); //TODO default join columns for specified xmlOneToOne mapping // XmlJoinColumn ormJoinColumn = ormOneToOneMapping.defaultJoinColumns().next(); @@ -796,13 +796,13 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase assertFalse(oneToOneMapping.isDefault()); oneToOneMapping.setSpecifiedFetch(FetchType.EAGER); oneToOneMapping.setSpecifiedTargetEntity("TargetEntity"); - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute("mappedBy"); + oneToOneMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy"); oneToOneMapping.getCascade().setAll(true); oneToOneMapping.getCascade().setMerge(true); oneToOneMapping.getCascade().setPersist(true); oneToOneMapping.getCascade().setRefresh(true); oneToOneMapping.getCascade().setRemove(true); - JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy().addSpecifiedJoinColumn(0); + JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnStrategy().addSpecifiedJoinColumn(0); joinColumn.setSpecifiedName("name"); joinColumn.setSpecifiedReferencedColumnName("referenceName"); assertFalse(oneToOneMapping.isDefault()); @@ -822,13 +822,13 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase assertFalse(oneToOneMapping.isDefault()); oneToOneMapping.setSpecifiedFetch(FetchType.EAGER); oneToOneMapping.setSpecifiedTargetEntity("TargetEntity"); - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute("mappedBy"); + oneToOneMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy"); oneToOneMapping.getCascade().setAll(true); oneToOneMapping.getCascade().setMerge(true); oneToOneMapping.getCascade().setPersist(true); oneToOneMapping.getCascade().setRefresh(true); oneToOneMapping.getCascade().setRemove(true); - JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy().addSpecifiedJoinColumn(0); + JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnStrategy().addSpecifiedJoinColumn(0); joinColumn.setSpecifiedName("name"); joinColumn.setSpecifiedReferencedColumnName("referenceName"); assertFalse(oneToOneMapping.isDefault()); @@ -848,13 +848,13 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase assertFalse(oneToOneMapping.isDefault()); oneToOneMapping.setSpecifiedFetch(FetchType.EAGER); oneToOneMapping.setSpecifiedTargetEntity("TargetEntity"); - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute("mappedBy"); + oneToOneMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy"); oneToOneMapping.getCascade().setAll(true); oneToOneMapping.getCascade().setMerge(true); oneToOneMapping.getCascade().setPersist(true); oneToOneMapping.getCascade().setRefresh(true); oneToOneMapping.getCascade().setRemove(true); - JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy().addSpecifiedJoinColumn(0); + JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnStrategy().addSpecifiedJoinColumn(0); joinColumn.setSpecifiedName("name"); joinColumn.setSpecifiedReferencedColumnName("referenceName"); assertFalse(oneToOneMapping.isDefault()); @@ -874,13 +874,13 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase assertFalse(oneToOneMapping.isDefault()); oneToOneMapping.setSpecifiedFetch(FetchType.EAGER); oneToOneMapping.setSpecifiedTargetEntity("TargetEntity"); - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute("mappedBy"); + oneToOneMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy"); oneToOneMapping.getCascade().setAll(true); oneToOneMapping.getCascade().setMerge(true); oneToOneMapping.getCascade().setPersist(true); oneToOneMapping.getCascade().setRefresh(true); oneToOneMapping.getCascade().setRemove(true); - JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy().addSpecifiedJoinColumn(0); + JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnStrategy().addSpecifiedJoinColumn(0); joinColumn.setSpecifiedName("name"); joinColumn.setSpecifiedReferencedColumnName("referenceName"); assertFalse(oneToOneMapping.isDefault()); @@ -900,13 +900,13 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase assertFalse(oneToOneMapping.isDefault()); oneToOneMapping.setSpecifiedFetch(FetchType.EAGER); oneToOneMapping.setSpecifiedTargetEntity("TargetEntity"); - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute("mappedBy"); + oneToOneMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy"); oneToOneMapping.getCascade().setAll(true); oneToOneMapping.getCascade().setMerge(true); oneToOneMapping.getCascade().setPersist(true); oneToOneMapping.getCascade().setRefresh(true); oneToOneMapping.getCascade().setRemove(true); - JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy().addSpecifiedJoinColumn(0); + JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnStrategy().addSpecifiedJoinColumn(0); joinColumn.setSpecifiedName("name"); joinColumn.setSpecifiedReferencedColumnName("referenceName"); assertFalse(oneToOneMapping.isDefault()); @@ -926,13 +926,13 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase assertFalse(oneToOneMapping.isDefault()); oneToOneMapping.setSpecifiedFetch(FetchType.EAGER); oneToOneMapping.setSpecifiedTargetEntity("TargetEntity"); - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute("mappedBy"); + oneToOneMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy"); oneToOneMapping.getCascade().setAll(true); oneToOneMapping.getCascade().setMerge(true); oneToOneMapping.getCascade().setPersist(true); oneToOneMapping.getCascade().setRefresh(true); oneToOneMapping.getCascade().setRemove(true); - JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy().addSpecifiedJoinColumn(0); + JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnStrategy().addSpecifiedJoinColumn(0); joinColumn.setSpecifiedName("name"); joinColumn.setSpecifiedReferencedColumnName("referenceName"); assertFalse(oneToOneMapping.isDefault()); @@ -944,7 +944,7 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase assertEquals("oneToOne", ormPersistentAttribute.getMapping().getName()); assertEquals(FetchType.EAGER, ((ManyToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch()); assertEquals("TargetEntity", ((ManyToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedTargetEntity()); - assertEquals("mappedBy", ((ManyToManyMapping) ormPersistentAttribute.getMapping()).getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + assertEquals("mappedBy", ((ManyToManyMapping) ormPersistentAttribute.getMapping()).getRelationship().getMappedByStrategy().getMappedByAttribute()); assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isAll()); assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isMerge()); assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isPersist()); @@ -960,13 +960,13 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase assertFalse(oneToOneMapping.isDefault()); oneToOneMapping.setSpecifiedFetch(FetchType.EAGER); oneToOneMapping.setSpecifiedTargetEntity("TargetEntity"); - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute("mappedBy"); + oneToOneMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy"); oneToOneMapping.getCascade().setAll(true); oneToOneMapping.getCascade().setMerge(true); oneToOneMapping.getCascade().setPersist(true); oneToOneMapping.getCascade().setRefresh(true); oneToOneMapping.getCascade().setRemove(true); - JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy().addSpecifiedJoinColumn(0); + JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnStrategy().addSpecifiedJoinColumn(0); joinColumn.setSpecifiedName("name"); joinColumn.setSpecifiedReferencedColumnName("referenceName"); assertFalse(oneToOneMapping.isDefault()); @@ -978,7 +978,7 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase assertEquals("oneToOne", ormPersistentAttribute.getMapping().getName()); assertEquals(FetchType.EAGER, ((OneToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch()); assertEquals("TargetEntity", ((OneToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedTargetEntity()); - assertEquals("mappedBy", ((OneToManyMapping) ormPersistentAttribute.getMapping()).getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + assertEquals("mappedBy", ((OneToManyMapping) ormPersistentAttribute.getMapping()).getRelationship().getMappedByStrategy().getMappedByAttribute()); assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isAll()); assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isMerge()); assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isPersist()); @@ -994,13 +994,13 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase assertFalse(oneToOneMapping.isDefault()); oneToOneMapping.setSpecifiedFetch(FetchType.EAGER); oneToOneMapping.setSpecifiedTargetEntity("TargetEntity"); - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute("mappedBy"); + oneToOneMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy"); oneToOneMapping.getCascade().setAll(true); oneToOneMapping.getCascade().setMerge(true); oneToOneMapping.getCascade().setPersist(true); oneToOneMapping.getCascade().setRefresh(true); oneToOneMapping.getCascade().setRemove(true); - JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy().addSpecifiedJoinColumn(0); + JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnStrategy().addSpecifiedJoinColumn(0); joinColumn.setSpecifiedName("name"); joinColumn.setSpecifiedReferencedColumnName("referenceName"); assertFalse(oneToOneMapping.isDefault()); @@ -1018,7 +1018,7 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isRefresh()); assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isRemove()); - joinColumn = ((ManyToOneMapping) ormPersistentAttribute.getMapping()).getRelationship().getJoinColumnJoiningStrategy().specifiedJoinColumns().next(); + joinColumn = ((ManyToOneMapping) ormPersistentAttribute.getMapping()).getRelationship().getJoinColumnStrategy().specifiedJoinColumns().next(); assertEquals("name", joinColumn.getName()); assertEquals("referenceName", joinColumn.getReferencedColumnName()); } @@ -1031,13 +1031,13 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase assertFalse(oneToOneMapping.isDefault()); oneToOneMapping.setSpecifiedFetch(FetchType.EAGER); oneToOneMapping.setSpecifiedTargetEntity("TargetEntity"); - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute("mappedBy"); + oneToOneMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy"); oneToOneMapping.getCascade().setAll(true); oneToOneMapping.getCascade().setMerge(true); oneToOneMapping.getCascade().setPersist(true); oneToOneMapping.getCascade().setRefresh(true); oneToOneMapping.getCascade().setRemove(true); - JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy().addSpecifiedJoinColumn(0); + JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnStrategy().addSpecifiedJoinColumn(0); joinColumn.setSpecifiedName("name"); joinColumn.setSpecifiedReferencedColumnName("referenceName"); assertFalse(oneToOneMapping.isDefault()); @@ -1058,7 +1058,7 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - OrmPrimaryKeyJoinColumnRelationshipStrategy strategy = ormOneToOneMapping.getRelationship().getPrimaryKeyJoinColumnJoiningStrategy(); + OrmPrimaryKeyJoinColumnRelationshipStrategy strategy = ormOneToOneMapping.getRelationship().getPrimaryKeyJoinColumnStrategy(); XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); OrmPrimaryKeyJoinColumn joinColumn = strategy.addPrimaryKeyJoinColumn(0); @@ -1094,7 +1094,7 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - OrmPrimaryKeyJoinColumnRelationshipStrategy strategy = ormOneToOneMapping.getRelationship().getPrimaryKeyJoinColumnJoiningStrategy(); + OrmPrimaryKeyJoinColumnRelationshipStrategy strategy = ormOneToOneMapping.getRelationship().getPrimaryKeyJoinColumnStrategy(); XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); strategy.addPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); @@ -1120,7 +1120,7 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "oneToOneMapping"); OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping(); - OrmPrimaryKeyJoinColumnRelationshipStrategy strategy = ormOneToOneMapping.getRelationship().getPrimaryKeyJoinColumnJoiningStrategy(); + OrmPrimaryKeyJoinColumnRelationshipStrategy strategy = ormOneToOneMapping.getRelationship().getPrimaryKeyJoinColumnStrategy(); XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0); strategy.addPrimaryKeyJoinColumn(0).setSpecifiedName("FOO"); @@ -1169,7 +1169,7 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); Iterator attributeNames = - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToOneMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -1178,12 +1178,12 @@ public class OrmOneToOneMappingTests extends ContextModelTestCase oneToOneMapping.setSpecifiedTargetEntity("foo"); attributeNames = - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToOneMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertFalse(attributeNames.hasNext()); oneToOneMapping.setSpecifiedTargetEntity(null); attributeNames = - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToOneMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaAssociationOverride2_0Tests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaAssociationOverride2_0Tests.java index 888c65b8a1..18b54e0e37 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaAssociationOverride2_0Tests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaAssociationOverride2_0Tests.java @@ -206,7 +206,7 @@ public class GenericJavaAssociationOverride2_0Tests extends Generic2_0ContextMod JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer(); AssociationOverride specifiedOverride = overrideContainer.virtualOverrides().next().convertToSpecified(); - JoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnStrategy(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild"); @@ -250,7 +250,7 @@ public class GenericJavaAssociationOverride2_0Tests extends Generic2_0ContextMod JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer(); AssociationOverride javaAssociationOverride = overrideContainer.virtualOverrides().next().convertToSpecified(); - JoinColumnRelationshipStrategy joiningStrategy = javaAssociationOverride.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joiningStrategy = javaAssociationOverride.getRelationship().getJoinColumnStrategy(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild"); AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDE); @@ -287,7 +287,7 @@ public class GenericJavaAssociationOverride2_0Tests extends Generic2_0ContextMod JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer(); AssociationOverride javaAssociationOverride = overrideContainer.virtualOverrides().next().convertToSpecified(); - JoinColumnRelationshipStrategy joiningStrategy = javaAssociationOverride.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joiningStrategy = javaAssociationOverride.getRelationship().getJoinColumnStrategy(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild"); AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDE); @@ -330,7 +330,7 @@ public class GenericJavaAssociationOverride2_0Tests extends Generic2_0ContextMod JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer(); JavaVirtualAssociationOverride virtualAssociationOverride = overrideContainer.virtualOverrides().next(); JavaAssociationOverride specifiedAssociationOverride = virtualAssociationOverride.convertToSpecified(); - JavaJoinColumnRelationshipStrategy joiningStrategy = specifiedAssociationOverride.getRelationship().getJoinColumnJoiningStrategy(); + JavaJoinColumnRelationshipStrategy joiningStrategy = specifiedAssociationOverride.getRelationship().getJoinColumnStrategy(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild"); AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDE); @@ -473,8 +473,8 @@ public class GenericJavaAssociationOverride2_0Tests extends Generic2_0ContextMod JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer(); ReadOnlyAssociationOverride javaAssociationOverride = overrideContainer.virtualOverrides().next(); javaAssociationOverride = ((VirtualAssociationOverride) javaAssociationOverride).convertToSpecified(); - ((OverrideRelationship2_0) javaAssociationOverride.getRelationship()).setJoinTableJoiningStrategy(); - JoinTableRelationshipStrategy joiningStrategy = ((OverrideRelationship2_0) javaAssociationOverride.getRelationship()).getJoinTableJoiningStrategy(); + ((OverrideRelationship2_0) javaAssociationOverride.getRelationship()).setStrategyToJoinTable(); + JoinTableRelationshipStrategy joiningStrategy = ((OverrideRelationship2_0) javaAssociationOverride.getRelationship()).getJoinTableStrategy(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild"); AssociationOverride2_0Annotation associationOverrideResource = (AssociationOverride2_0Annotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDE); @@ -495,8 +495,8 @@ public class GenericJavaAssociationOverride2_0Tests extends Generic2_0ContextMod JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer(); ReadOnlyAssociationOverride javaAssociationOverride = overrideContainer.virtualOverrides().next(); javaAssociationOverride = ((VirtualAssociationOverride) javaAssociationOverride).convertToSpecified(); - ((OverrideRelationship2_0) javaAssociationOverride.getRelationship()).setJoinTableJoiningStrategy(); - JoinTableRelationshipStrategy joiningStrategy = ((OverrideRelationship2_0) javaAssociationOverride.getRelationship()).getJoinTableJoiningStrategy(); + ((OverrideRelationship2_0) javaAssociationOverride.getRelationship()).setStrategyToJoinTable(); + JoinTableRelationshipStrategy joiningStrategy = ((OverrideRelationship2_0) javaAssociationOverride.getRelationship()).getJoinTableStrategy(); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(PACKAGE_NAME + ".AnnotationTestTypeChild"); AssociationOverride2_0Annotation associationOverrideResource = (AssociationOverride2_0Annotation) typeResource.getAnnotation(JPA.ASSOCIATION_OVERRIDE); @@ -563,7 +563,7 @@ public class GenericJavaAssociationOverride2_0Tests extends Generic2_0ContextMod JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer(); ReadOnlyAssociationOverride javaAssociationOverride = overrideContainer.virtualOverrides().next(); VirtualOverrideRelationship2_0 rel = (VirtualOverrideRelationship2_0) javaAssociationOverride.getRelationship(); - VirtualJoinTable joinTable = rel.getJoinTableJoiningStrategy().getJoinTable(); + VirtualJoinTable joinTable = rel.getJoinTableStrategy().getJoinTable(); assertEquals("AnnotationTestTypeChild_AnnotationTestTypeChild", joinTable.getName()); @@ -573,7 +573,7 @@ public class GenericJavaAssociationOverride2_0Tests extends Generic2_0ContextMod PersistentType mappedSuperclass = getJavaEntity().getPersistentType().getSuperPersistentType(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) mappedSuperclass.getAttributeNamed("address").getMapping(); - manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("BAR"); + manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("BAR"); assertEquals("BAR", joinTable.getName()); } diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaEmbeddedMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaEmbeddedMapping2_0Tests.java index e33a88062c..1192edbcf7 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaEmbeddedMapping2_0Tests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaEmbeddedMapping2_0Tests.java @@ -966,7 +966,7 @@ public class GenericJavaEmbeddedMapping2_0Tests extends Generic2_0ContextModelTe assertEquals(2, overrideContainer.virtualOverridesSize()); VirtualAssociationOverride virtualAssociationOverride = overrideContainer.virtualOverrides().next(); - VirtualJoinColumnRelationshipStrategy joiningStrategy = ((VirtualJoinColumnRelationship) virtualAssociationOverride.getRelationship()).getJoinColumnJoiningStrategy(); + VirtualJoinColumnRelationshipStrategy joiningStrategy = ((VirtualJoinColumnRelationship) virtualAssociationOverride.getRelationship()).getJoinColumnStrategy(); assertEquals("address", virtualAssociationOverride.getName()); assertEquals(1, joiningStrategy.joinColumnsSize()); VirtualJoinColumn virtualJoinColumn = joiningStrategy.joinColumns().next(); @@ -983,7 +983,7 @@ public class GenericJavaEmbeddedMapping2_0Tests extends Generic2_0ContextModelTe classRefs.next(); JavaPersistentType javaEmbeddable = classRefs.next().getJavaPersistentType(); OneToOneMapping oneToOneMapping = (OneToOneMapping) javaEmbeddable.getAttributeNamed("address").getMapping(); - JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy().addSpecifiedJoinColumn(0); + JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnStrategy().addSpecifiedJoinColumn(0); joinColumn.setSpecifiedName("MY_JOIN_COLUMN"); joinColumn.setSpecifiedReferencedColumnName("MY_REFERENCE_COLUMN"); joinColumn.setSpecifiedTable("BAR"); @@ -998,7 +998,7 @@ public class GenericJavaEmbeddedMapping2_0Tests extends Generic2_0ContextModelTe assertEquals(2, overrideContainer.virtualOverridesSize()); virtualAssociationOverride = overrideContainer.virtualOverrides().next(); - joiningStrategy = ((VirtualJoinColumnRelationship) virtualAssociationOverride.getRelationship()).getJoinColumnJoiningStrategy(); + joiningStrategy = ((VirtualJoinColumnRelationship) virtualAssociationOverride.getRelationship()).getJoinColumnStrategy(); assertEquals("address", virtualAssociationOverride.getName()); assertEquals(1, joiningStrategy.joinColumnsSize()); virtualAssociationOverride = overrideContainer.virtualOverrides().next(); @@ -1320,7 +1320,7 @@ public class GenericJavaEmbeddedMapping2_0Tests extends Generic2_0ContextModelTe assertEquals(2, overrideContainer.virtualOverridesSize()); VirtualAssociationOverride virtualAssociationOverride = CollectionTools.get(overrideContainer.virtualOverrides(), 1); - VirtualJoinTableRelationshipStrategy joiningStrategy = ((VirtualOverrideRelationship2_0) virtualAssociationOverride.getRelationship()).getJoinTableJoiningStrategy(); + VirtualJoinTableRelationshipStrategy joiningStrategy = ((VirtualOverrideRelationship2_0) virtualAssociationOverride.getRelationship()).getJoinTableStrategy(); VirtualJoinTable joinTable = joiningStrategy.getJoinTable(); assertEquals("addresses", virtualAssociationOverride.getName()); assertEquals("AnnotationTestType_Address", joinTable.getName()); @@ -1350,7 +1350,7 @@ public class GenericJavaEmbeddedMapping2_0Tests extends Generic2_0ContextModelTe classRefs.next(); JavaPersistentType javaEmbeddable = classRefs.next().getJavaPersistentType(); OneToManyMapping oneToManyMapping = (OneToManyMapping) javaEmbeddable.getAttributeNamed("addresses").getMapping(); - JoinTableRelationshipStrategy joinTableStrategy = oneToManyMapping.getRelationship().getJoinTableJoiningStrategy(); + JoinTableRelationshipStrategy joinTableStrategy = oneToManyMapping.getRelationship().getJoinTableStrategy(); joinTableStrategy.getJoinTable().setSpecifiedName("MY_JOIN_TABLE"); JoinColumn joinColumn = joinTableStrategy.getJoinTable().addSpecifiedJoinColumn(0); joinColumn.setSpecifiedName("MY_JOIN_COLUMN"); @@ -1377,7 +1377,7 @@ public class GenericJavaEmbeddedMapping2_0Tests extends Generic2_0ContextModelTe assertEquals(2, overrideContainer.virtualOverridesSize()); virtualAssociationOverride = CollectionTools.get(overrideContainer.virtualOverrides(), 1); - joiningStrategy = ((VirtualOverrideRelationship2_0) virtualAssociationOverride.getRelationship()).getJoinTableJoiningStrategy(); + joiningStrategy = ((VirtualOverrideRelationship2_0) virtualAssociationOverride.getRelationship()).getJoinTableStrategy(); joinTable = joiningStrategy.getJoinTable(); assertEquals("addresses", virtualAssociationOverride.getName()); assertEquals(1, joinTable.joinColumnsSize()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaEntity2_0Tests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaEntity2_0Tests.java index ce91e42975..8e2ea494b7 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaEntity2_0Tests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaEntity2_0Tests.java @@ -2062,7 +2062,7 @@ public class GenericJavaEntity2_0Tests extends Generic2_0ContextModelTestCase associationOverride = getJavaEntity().getAssociationOverrideContainer().specifiedOverrides().next(); assertEquals("a", associationOverride.getName()); - JoinTable joinTable = ((JavaOverrideRelationship2_0) associationOverride.getRelationship()).getJoinTableJoiningStrategy().getJoinTable(); + JoinTable joinTable = ((JavaOverrideRelationship2_0) associationOverride.getRelationship()).getJoinTableStrategy().getJoinTable(); assertEquals("FOO", joinTable.getSpecifiedName()); assertEquals("BAR", joinTable.inverseJoinColumns().next().getName()); } diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaManyToManyMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaManyToManyMapping2_0Tests.java index 935fe3731c..08e0bc403a 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaManyToManyMapping2_0Tests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaManyToManyMapping2_0Tests.java @@ -327,7 +327,7 @@ public class GenericJavaManyToManyMapping2_0Tests ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); Iterator attributeNames = - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + manyToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -339,12 +339,12 @@ public class GenericJavaManyToManyMapping2_0Tests manyToManyMapping.setSpecifiedTargetEntity("foo"); attributeNames = - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + manyToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertFalse(attributeNames.hasNext()); manyToManyMapping.setSpecifiedTargetEntity(null); attributeNames = - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + manyToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -370,7 +370,7 @@ public class GenericJavaManyToManyMapping2_0Tests ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); Iterator attributeNames = - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + manyToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -381,12 +381,12 @@ public class GenericJavaManyToManyMapping2_0Tests manyToManyMapping.setSpecifiedTargetEntity("foo"); attributeNames = - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + manyToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertFalse(attributeNames.hasNext()); manyToManyMapping.setSpecifiedTargetEntity(null); attributeNames = - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + manyToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -665,7 +665,7 @@ public class GenericJavaManyToManyMapping2_0Tests assertEquals("MY_TABLE_OTHER_TABLE", jobsOrderColumn.getTable()); assertEquals("MY_TABLE_OTHER_TABLE", queuesOrderColumn.getTable()); - queuesMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE"); + queuesMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE"); assertEquals("MY_JOIN_TABLE", jobsOrderColumn.getTable()); assertEquals("MY_JOIN_TABLE", queuesOrderColumn.getTable()); } @@ -759,7 +759,7 @@ public class GenericJavaManyToManyMapping2_0Tests assertEquals("addresses_KEY", manyToManyMapping.getMapKeyColumn().getName()); assertEquals(TYPE_NAME + "_Address", manyToManyMapping.getMapKeyColumn().getTable());//join table name - manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("MY_PRIMARY_TABLE"); + manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_PRIMARY_TABLE"); assertEquals("MY_PRIMARY_TABLE", manyToManyMapping.getMapKeyColumn().getTable()); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); @@ -781,8 +781,8 @@ public class GenericJavaManyToManyMapping2_0Tests PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping(); - manyToManyMapping.getRelationship().setMappedByJoiningStrategy(); - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute("employees"); + manyToManyMapping.getRelationship().setStrategyToMappedBy(); + manyToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("employees"); assertNull(manyToManyMapping.getMapKeyColumn().getSpecifiedName()); assertEquals("addresses_KEY", manyToManyMapping.getMapKeyColumn().getName()); @@ -790,7 +790,7 @@ public class GenericJavaManyToManyMapping2_0Tests PersistentType persistentType = getPersistenceUnit().getPersistentType("test.Address"); ManyToManyMapping owningManyToManyMapping = (ManyToManyMapping) persistentType.getAttributeNamed("employees").getMapping(); - ((JoinTableRelationshipStrategy) owningManyToManyMapping.getRelationship().getPredominantJoiningStrategy()).getJoinTable().setSpecifiedName("MY_JOIN_TABLE"); + ((JoinTableRelationshipStrategy) owningManyToManyMapping.getRelationship().getStrategy()).getJoinTable().setSpecifiedName("MY_JOIN_TABLE"); assertEquals("MY_JOIN_TABLE", manyToManyMapping.getMapKeyColumn().getTable()); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); @@ -817,7 +817,7 @@ public class GenericJavaManyToManyMapping2_0Tests assertEquals("addresses_KEY", manyToManyMapping.getMapKeyColumn().getName()); assertEquals(TYPE_NAME + "_Address", manyToManyMapping.getMapKeyColumn().getTable());//join table name - manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE"); + manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE"); assertEquals("MY_JOIN_TABLE", manyToManyMapping.getMapKeyColumn().getTable()); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0Tests.java index 5df88cfd02..e7db5bab59 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0Tests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0Tests.java @@ -352,26 +352,26 @@ public class GenericJavaManyToOneMapping2_0Tests assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); - rel.setJoinColumnJoiningStrategy(); + rel.setStrategyToJoinColumn(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); - rel.setJoinTableJoiningStrategy(); + rel.setStrategyToJoinTable(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); - rel.setJoinColumnJoiningStrategy(); + rel.setStrategyToJoinColumn(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); } public void testUpdatePredominantJoiningStrategy() throws Exception { @@ -385,35 +385,35 @@ public class GenericJavaManyToOneMapping2_0Tests assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); resourceAttribute.addAnnotation(JPA.JOIN_COLUMN); getJpaProject().synchronizeContextModel(); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); resourceAttribute.addAnnotation(JPA.JOIN_TABLE); getJpaProject().synchronizeContextModel(); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); resourceAttribute.removeAnnotation(JPA.JOIN_COLUMN); getJpaProject().synchronizeContextModel(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); resourceAttribute.removeAnnotation(JPA.JOIN_TABLE); getJpaProject().synchronizeContextModel(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); } } diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaOneToManyMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaOneToManyMapping2_0Tests.java index 80d952a81f..9c492acae8 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaOneToManyMapping2_0Tests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaOneToManyMapping2_0Tests.java @@ -352,7 +352,7 @@ public class GenericJavaOneToManyMapping2_0Tests OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); Iterator attributeNames = - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -364,12 +364,12 @@ public class GenericJavaOneToManyMapping2_0Tests oneToManyMapping.setSpecifiedTargetEntity("foo"); attributeNames = - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertFalse(attributeNames.hasNext()); oneToManyMapping.setSpecifiedTargetEntity(null); attributeNames = - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -395,7 +395,7 @@ public class GenericJavaOneToManyMapping2_0Tests OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); Iterator attributeNames = - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -406,12 +406,12 @@ public class GenericJavaOneToManyMapping2_0Tests oneToManyMapping.setSpecifiedTargetEntity("foo"); attributeNames = - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertFalse(attributeNames.hasNext()); oneToManyMapping.setSpecifiedTargetEntity(null); attributeNames = - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -898,8 +898,8 @@ public class GenericJavaOneToManyMapping2_0Tests PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping(); - oneToManyMapping.getRelationship().setMappedByJoiningStrategy(); - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute("employee"); + oneToManyMapping.getRelationship().setStrategyToMappedBy(); + oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("employee"); assertNull(oneToManyMapping.getMapKeyColumn().getSpecifiedName()); assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getName()); @@ -933,7 +933,7 @@ public class GenericJavaOneToManyMapping2_0Tests assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getName()); assertEquals(TYPE_NAME + "_Address", oneToManyMapping.getMapKeyColumn().getTable());//join table name - oneToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("MY_PRIMARY_TABLE"); + oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_PRIMARY_TABLE"); assertEquals("MY_PRIMARY_TABLE", oneToManyMapping.getMapKeyColumn().getTable()); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); @@ -955,9 +955,9 @@ public class GenericJavaOneToManyMapping2_0Tests PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping(); - ((JoinColumnRelationship) oneToManyMapping.getRelationship()).setJoinColumnJoiningStrategy(); + ((JoinColumnRelationship) oneToManyMapping.getRelationship()).setStrategyToJoinColumn(); - JoinColumn joinColumn = ((JoinColumnRelationship) oneToManyMapping.getRelationship()).getJoinColumnJoiningStrategy().specifiedJoinColumns().next(); + JoinColumn joinColumn = ((JoinColumnRelationship) oneToManyMapping.getRelationship()).getJoinColumnStrategy().specifiedJoinColumns().next(); assertEquals("addresses_id", joinColumn.getDefaultName()); assertEquals("Address", joinColumn.getDefaultTable());//target table name @@ -981,7 +981,7 @@ public class GenericJavaOneToManyMapping2_0Tests PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping(); - ((JoinColumnRelationship) oneToManyMapping.getRelationship()).setJoinColumnJoiningStrategy(); + ((JoinColumnRelationship) oneToManyMapping.getRelationship()).setStrategyToJoinColumn(); assertNull(oneToManyMapping.getMapKeyColumn().getSpecifiedName()); assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getName()); @@ -1012,7 +1012,7 @@ public class GenericJavaOneToManyMapping2_0Tests PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping(); - ((JoinColumnRelationship) oneToManyMapping.getRelationship()).setJoinColumnJoiningStrategy(); + ((JoinColumnRelationship) oneToManyMapping.getRelationship()).setStrategyToJoinColumn(); ((Orderable2_0) oneToManyMapping.getOrderable()).setOrderColumnOrdering(true); OrderColumn2_0 orderColumn = ((Orderable2_0) oneToManyMapping.getOrderable()).getOrderColumn(); @@ -1039,33 +1039,33 @@ public class GenericJavaOneToManyMapping2_0Tests assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); - rel.setJoinColumnJoiningStrategy(); + rel.setStrategyToJoinColumn(); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); - rel.setMappedByJoiningStrategy(); + rel.setStrategyToMappedBy(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNotNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); - rel.setJoinTableJoiningStrategy(); + rel.setStrategyToJoinTable(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); } public void testUpdatePredominantJoiningStrategy() throws Exception { @@ -1081,63 +1081,63 @@ public class GenericJavaOneToManyMapping2_0Tests assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); annotation.setMappedBy("foo"); getJpaProject().synchronizeContextModel(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNotNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); resourceAttribute.addAnnotation(JPA.JOIN_TABLE); getJpaProject().synchronizeContextModel(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNotNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); resourceAttribute.addAnnotation(JPA.JOIN_COLUMN); getJpaProject().synchronizeContextModel(); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNotNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); annotation.setMappedBy(null); getJpaProject().synchronizeContextModel(); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); resourceAttribute.removeAnnotation(JPA.JOIN_TABLE); getJpaProject().synchronizeContextModel(); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); resourceAttribute.removeAnnotation(JPA.JOIN_COLUMN); getJpaProject().synchronizeContextModel(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); } public void testMapKeySpecifiedAttributeOverrides() throws Exception { diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0Tests.java index 45a5021c5f..2d107344d3 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0Tests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0Tests.java @@ -501,7 +501,7 @@ public class GenericJavaOneToOneMapping2_0Tests OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); Iterator attributeNames = - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToOneMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -512,12 +512,12 @@ public class GenericJavaOneToOneMapping2_0Tests oneToOneMapping.setSpecifiedTargetEntity("foo"); attributeNames = - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToOneMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertFalse(attributeNames.hasNext()); oneToOneMapping.setSpecifiedTargetEntity(null); attributeNames = - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToOneMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -542,7 +542,7 @@ public class GenericJavaOneToOneMapping2_0Tests OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); Iterator attributeNames = - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToOneMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -553,12 +553,12 @@ public class GenericJavaOneToOneMapping2_0Tests oneToOneMapping.setSpecifiedTargetEntity("foo"); attributeNames = - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToOneMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertFalse(attributeNames.hasNext()); oneToOneMapping.setSpecifiedTargetEntity(null); attributeNames = - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToOneMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -728,50 +728,50 @@ public class GenericJavaOneToOneMapping2_0Tests assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNull(annotation.getMappedBy()); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); - rel.setPrimaryKeyJoinColumnJoiningStrategy(); + rel.setStrategyToPrimaryKeyJoinColumn(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNotNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNull(annotation.getMappedBy()); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); - rel.setMappedByJoiningStrategy(); + rel.setStrategyToMappedBy(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNotNull(annotation.getMappedBy()); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertTrue(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); - rel.setJoinTableJoiningStrategy(); + rel.setStrategyToJoinTable(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNull(annotation.getMappedBy()); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertTrue(rel.strategyIsJoinTable()); - rel.setJoinColumnJoiningStrategy(); + rel.setStrategyToJoinColumn(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNull(annotation.getMappedBy()); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); } public void testUpdatePredominantJoiningStrategy() throws Exception { @@ -788,10 +788,10 @@ public class GenericJavaOneToOneMapping2_0Tests assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNull(annotation.getMappedBy()); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); resourceAttribute.addAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN); getJpaProject().synchronizeContextModel(); @@ -799,10 +799,10 @@ public class GenericJavaOneToOneMapping2_0Tests assertNotNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNull(annotation.getMappedBy()); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); annotation.setMappedBy("foo"); getJpaProject().synchronizeContextModel(); @@ -810,10 +810,10 @@ public class GenericJavaOneToOneMapping2_0Tests assertNotNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNotNull(annotation.getMappedBy()); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertTrue(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); resourceAttribute.addAnnotation(JPA.JOIN_COLUMN); getJpaProject().synchronizeContextModel(); @@ -821,10 +821,10 @@ public class GenericJavaOneToOneMapping2_0Tests assertNotNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNotNull(annotation.getMappedBy()); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertTrue(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); resourceAttribute.addAnnotation(JPA.JOIN_TABLE); getJpaProject().synchronizeContextModel(); @@ -832,10 +832,10 @@ public class GenericJavaOneToOneMapping2_0Tests assertNotNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNotNull(annotation.getMappedBy()); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertTrue(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); resourceAttribute.removeAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN); getJpaProject().synchronizeContextModel(); @@ -843,10 +843,10 @@ public class GenericJavaOneToOneMapping2_0Tests assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNotNull(annotation.getMappedBy()); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertTrue(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); annotation.setMappedBy(null); getJpaProject().synchronizeContextModel(); @@ -854,10 +854,10 @@ public class GenericJavaOneToOneMapping2_0Tests assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNull(annotation.getMappedBy()); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertTrue(rel.strategyIsJoinTable()); resourceAttribute.removeAnnotation(JPA.JOIN_COLUMN); getJpaProject().synchronizeContextModel(); @@ -865,10 +865,10 @@ public class GenericJavaOneToOneMapping2_0Tests assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNull(annotation.getMappedBy()); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertTrue(rel.strategyIsJoinTable()); resourceAttribute.removeAnnotation(JPA.JOIN_TABLE); getJpaProject().synchronizeContextModel(); @@ -876,9 +876,9 @@ public class GenericJavaOneToOneMapping2_0Tests assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNull(annotation.getMappedBy()); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); } } diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/orm/GenericOrmAssociationOverride2_0Tests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/orm/GenericOrmAssociationOverride2_0Tests.java index 83488f0fd6..a47f2de5f3 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/orm/GenericOrmAssociationOverride2_0Tests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/orm/GenericOrmAssociationOverride2_0Tests.java @@ -204,7 +204,7 @@ public class GenericOrmAssociationOverride2_0Tests extends Generic2_0ContextMode assertEquals("address", ormAssociationOverride.getName()); OrmAssociationOverride specifiedOverride = ormAssociationOverride.convertToSpecified(); - OrmJoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnJoiningStrategy(); + OrmJoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnStrategy(); XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0); @@ -253,7 +253,7 @@ public class GenericOrmAssociationOverride2_0Tests extends Generic2_0ContextMode assertEquals("address", ormAssociationOverride.getName()); AssociationOverride specifiedOverride = ormAssociationOverride.convertToSpecified(); - JoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnJoiningStrategy(); + JoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnStrategy(); XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0); @@ -296,7 +296,7 @@ public class GenericOrmAssociationOverride2_0Tests extends Generic2_0ContextMode assertEquals("address", ormAssociationOverride.getName()); OrmAssociationOverride specifiedOverride = ormAssociationOverride.convertToSpecified(); - OrmJoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnJoiningStrategy(); + OrmJoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnStrategy(); XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0); XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0); @@ -343,7 +343,7 @@ public class GenericOrmAssociationOverride2_0Tests extends Generic2_0ContextMode assertEquals("address", ormAssociationOverride.getName()); OrmAssociationOverride specifiedOverride = ormAssociationOverride.convertToSpecified(); - OrmJoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnJoiningStrategy(); + OrmJoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnStrategy(); XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0); XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0); @@ -431,8 +431,8 @@ public class GenericOrmAssociationOverride2_0Tests extends Generic2_0ContextMode OrmVirtualAssociationOverride virtualOverride = overrideContainer.virtualOverrides().next(); OrmAssociationOverride associationOverride = virtualOverride.convertToSpecified(); - ((OverrideRelationship2_0) associationOverride.getRelationship()).setJoinTableJoiningStrategy(); - JoinTableRelationshipStrategy joiningStrategy = ((OverrideRelationship2_0) associationOverride.getRelationship()).getJoinTableJoiningStrategy(); + ((OverrideRelationship2_0) associationOverride.getRelationship()).setStrategyToJoinTable(); + JoinTableRelationshipStrategy joiningStrategy = ((OverrideRelationship2_0) associationOverride.getRelationship()).getJoinTableStrategy(); XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0); XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0); @@ -454,8 +454,8 @@ public class GenericOrmAssociationOverride2_0Tests extends Generic2_0ContextMode OrmVirtualAssociationOverride virtualOverride = overrideContainer.virtualOverrides().next(); OrmAssociationOverride associationOverride = virtualOverride.convertToSpecified(); - ((OrmOverrideRelationship2_0) associationOverride.getRelationship()).setJoinTableJoiningStrategy(); - OrmJoinTableRelationshipStrategy joiningStrategy = ((OrmOverrideRelationship2_0) associationOverride.getRelationship()).getJoinTableJoiningStrategy(); + ((OrmOverrideRelationship2_0) associationOverride.getRelationship()).setStrategyToJoinTable(); + OrmJoinTableRelationshipStrategy joiningStrategy = ((OrmOverrideRelationship2_0) associationOverride.getRelationship()).getJoinTableStrategy(); XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0); XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0); @@ -515,7 +515,7 @@ public class GenericOrmAssociationOverride2_0Tests extends Generic2_0ContextMode OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer(); ReadOnlyAssociationOverride associationOverride = overrideContainer.virtualOverrides().next(); - VirtualJoinTableRelationshipStrategy joiningStrategy = ((VirtualOverrideRelationship2_0) associationOverride.getRelationship()).getJoinTableJoiningStrategy(); + VirtualJoinTableRelationshipStrategy joiningStrategy = ((VirtualOverrideRelationship2_0) associationOverride.getRelationship()).getJoinTableStrategy(); VirtualJoinTable joinTable = joiningStrategy.getJoinTable(); @@ -528,7 +528,7 @@ public class GenericOrmAssociationOverride2_0Tests extends Generic2_0ContextMode PersistentType mappedSuperclass = ormPersistentType.getSuperPersistentType(); ((OrmReadOnlyPersistentAttribute) mappedSuperclass.getAttributeNamed("address")).convertToSpecified(); ManyToManyMapping manyToManyMapping = (ManyToManyMapping) mappedSuperclass.getAttributeNamed("address").getMapping(); - manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("BAR"); - assertEquals("BAR", manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().getName()); + manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("BAR"); + assertEquals("BAR", manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().getName()); } } diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/orm/GenericOrmEmbeddedMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/orm/GenericOrmEmbeddedMapping2_0Tests.java index 9935882f60..0578140495 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/orm/GenericOrmEmbeddedMapping2_0Tests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/orm/GenericOrmEmbeddedMapping2_0Tests.java @@ -1088,7 +1088,7 @@ public class GenericOrmEmbeddedMapping2_0Tests extends Generic2_0ContextModelTes assertEquals(2, overrideContainer.virtualOverridesSize()); VirtualAssociationOverride virtualAssociationOverride = overrideContainer.virtualOverrides().next(); - VirtualJoinColumnRelationshipStrategy joiningStrategy = ((VirtualJoinColumnRelationship) virtualAssociationOverride.getRelationship()).getJoinColumnJoiningStrategy(); + VirtualJoinColumnRelationshipStrategy joiningStrategy = ((VirtualJoinColumnRelationship) virtualAssociationOverride.getRelationship()).getJoinColumnStrategy(); assertEquals("address", virtualAssociationOverride.getName()); assertEquals(1, joiningStrategy.joinColumnsSize()); VirtualJoinColumn virtualJoinColumn = joiningStrategy.joinColumns().next(); @@ -1104,7 +1104,7 @@ public class GenericOrmEmbeddedMapping2_0Tests extends Generic2_0ContextModelTes JavaPersistentType javaEmbeddable = getPersistenceUnit().specifiedClassRefs().next().getJavaPersistentType(); OneToOneMapping oneToOneMapping = (OneToOneMapping) javaEmbeddable.getAttributeNamed("address").getMapping(); - JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy().addSpecifiedJoinColumn(0); + JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnStrategy().addSpecifiedJoinColumn(0); joinColumn.setSpecifiedName("MY_JOIN_COLUMN"); joinColumn.setSpecifiedReferencedColumnName("MY_REFERENCE_COLUMN"); joinColumn.setSpecifiedTable("BAR"); @@ -1116,7 +1116,7 @@ public class GenericOrmEmbeddedMapping2_0Tests extends Generic2_0ContextModelTes assertEquals(2, overrideContainer.virtualOverridesSize()); virtualAssociationOverride = overrideContainer.virtualOverrides().next(); - joiningStrategy = ((VirtualJoinColumnRelationship) virtualAssociationOverride.getRelationship()).getJoinColumnJoiningStrategy(); + joiningStrategy = ((VirtualJoinColumnRelationship) virtualAssociationOverride.getRelationship()).getJoinColumnStrategy(); assertEquals("address", virtualAssociationOverride.getName()); assertEquals(1, joiningStrategy.joinColumnsSize()); virtualAssociationOverride = overrideContainer.virtualOverrides().next(); @@ -1434,7 +1434,7 @@ public class GenericOrmEmbeddedMapping2_0Tests extends Generic2_0ContextModelTes assertEquals(2, overrideContainer.virtualOverridesSize()); VirtualAssociationOverride virtualAssociationOverride = CollectionTools.get(overrideContainer.virtualOverrides(), 1); - VirtualJoinTableRelationshipStrategy joiningStrategy = ((VirtualOverrideRelationship2_0) virtualAssociationOverride.getRelationship()).getJoinTableJoiningStrategy(); + VirtualJoinTableRelationshipStrategy joiningStrategy = ((VirtualOverrideRelationship2_0) virtualAssociationOverride.getRelationship()).getJoinTableStrategy(); ReadOnlyJoinTable joinTable = joiningStrategy.getJoinTable(); assertEquals("addresses", virtualAssociationOverride.getName()); assertEquals("AnnotationTestType_Address", joinTable.getName()); @@ -1462,7 +1462,7 @@ public class GenericOrmEmbeddedMapping2_0Tests extends Generic2_0ContextModelTes JavaPersistentType javaEmbeddable = getPersistenceUnit().specifiedClassRefs().next().getJavaPersistentType(); OneToManyMapping oneToManyMapping = (OneToManyMapping) javaEmbeddable.getAttributeNamed("addresses").getMapping(); - JoinTableRelationshipStrategy joinTableStrategy = oneToManyMapping.getRelationship().getJoinTableJoiningStrategy(); + JoinTableRelationshipStrategy joinTableStrategy = oneToManyMapping.getRelationship().getJoinTableStrategy(); joinTableStrategy.getJoinTable().setSpecifiedName("MY_JOIN_TABLE"); JoinColumn joinColumn = joinTableStrategy.getJoinTable().addSpecifiedJoinColumn(0); joinColumn.setSpecifiedName("MY_JOIN_COLUMN"); @@ -1486,7 +1486,7 @@ public class GenericOrmEmbeddedMapping2_0Tests extends Generic2_0ContextModelTes assertEquals(2, overrideContainer.virtualOverridesSize()); virtualAssociationOverride = CollectionTools.get(overrideContainer.virtualOverrides(), 1); - joiningStrategy = ((VirtualOverrideRelationship2_0) virtualAssociationOverride.getRelationship()).getJoinTableJoiningStrategy(); + joiningStrategy = ((VirtualOverrideRelationship2_0) virtualAssociationOverride.getRelationship()).getJoinTableStrategy(); joinTable = joiningStrategy.getJoinTable(); assertEquals("addresses", virtualAssociationOverride.getName()); assertEquals(1, joinTable.joinColumnsSize()); @@ -1518,7 +1518,7 @@ public class GenericOrmEmbeddedMapping2_0Tests extends Generic2_0ContextModelTes javaAssociationOverrides.next(); JavaAssociationOverride javaAssociationOverride = ((JavaVirtualAssociationOverride) javaAssociationOverrides.next()).convertToSpecified(); assertEquals("addresses", javaAssociationOverride.getName()); - JavaJoinTable javaJoinTable = ((JavaOverrideRelationship2_0) javaAssociationOverride.getRelationship()).getJoinTableJoiningStrategy().getJoinTable(); + JavaJoinTable javaJoinTable = ((JavaOverrideRelationship2_0) javaAssociationOverride.getRelationship()).getJoinTableStrategy().getJoinTable(); javaJoinTable.setSpecifiedName("JAVA_FOO"); JavaJoinColumn javaJoinColumn = javaJoinTable.addSpecifiedJoinColumn(0); javaJoinColumn.setSpecifiedName("JAVA_JOIN_COLUMN_NAME"); @@ -1531,7 +1531,7 @@ public class GenericOrmEmbeddedMapping2_0Tests extends Generic2_0ContextModelTes assertEquals(2, overrideContainer.virtualOverridesSize()); virtualAssociationOverride = CollectionTools.get(overrideContainer.virtualOverrides(), 1); - joiningStrategy = ((VirtualOverrideRelationship2_0) virtualAssociationOverride.getRelationship()).getJoinTableJoiningStrategy(); + joiningStrategy = ((VirtualOverrideRelationship2_0) virtualAssociationOverride.getRelationship()).getJoinTableStrategy(); joinTable = joiningStrategy.getJoinTable(); assertEquals("addresses", virtualAssociationOverride.getName()); assertEquals("MY_JOIN_TABLE", joinTable.getName()); @@ -1571,7 +1571,7 @@ public class GenericOrmEmbeddedMapping2_0Tests extends Generic2_0ContextModelTes overrideContainer = virtualEmbeddedMapping.getAssociationOverrideContainer(); AssociationOverride associationOverride = overrideContainer.specifiedOverrides().next(); assertEquals("addresses", associationOverride.getName()); - ReadOnlyJoinTableRelationshipStrategy strategy = ((ReadOnlyOverrideRelationship2_0) associationOverride.getRelationship()).getJoinTableJoiningStrategy(); + ReadOnlyJoinTableRelationshipStrategy strategy = ((ReadOnlyOverrideRelationship2_0) associationOverride.getRelationship()).getJoinTableStrategy(); joinTable = strategy.getJoinTable(); assertEquals("JAVA_FOO", joinTable.getName()); assertEquals(2, joinTable.joinColumnsSize()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/orm/GenericOrmEntity2_0Tests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/orm/GenericOrmEntity2_0Tests.java index d62cef5026..24c55c398b 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/orm/GenericOrmEntity2_0Tests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/orm/GenericOrmEntity2_0Tests.java @@ -1965,7 +1965,7 @@ public class GenericOrmEntity2_0Tests extends Generic2_0ContextModelTestCase associationOverride = entity.getAssociationOverrideContainer().specifiedOverrides().next(); assertEquals("a", associationOverride.getName()); - JoinTable joinTable = ((OrmOverrideRelationship2_0) associationOverride.getRelationship()).getJoinTableJoiningStrategy().getJoinTable(); + JoinTable joinTable = ((OrmOverrideRelationship2_0) associationOverride.getRelationship()).getJoinTableStrategy().getJoinTable(); assertEquals("FOO", joinTable.getSpecifiedName()); assertEquals("BAR", joinTable.inverseJoinColumns().next().getName()); } diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/orm/GenericOrmManyToManyMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/orm/GenericOrmManyToManyMapping2_0Tests.java index 2e26218512..882b9c8491 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/orm/GenericOrmManyToManyMapping2_0Tests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/orm/GenericOrmManyToManyMapping2_0Tests.java @@ -250,7 +250,7 @@ public class GenericOrmManyToManyMapping2_0Tests ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); Iterator attributeNames = - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + manyToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -261,12 +261,12 @@ public class GenericOrmManyToManyMapping2_0Tests manyToManyMapping.setSpecifiedTargetEntity("foo"); attributeNames = - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + manyToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertFalse(attributeNames.hasNext()); manyToManyMapping.setSpecifiedTargetEntity(null); attributeNames = - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + manyToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -296,7 +296,7 @@ public class GenericOrmManyToManyMapping2_0Tests ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); Iterator attributeNames = - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + manyToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -307,12 +307,12 @@ public class GenericOrmManyToManyMapping2_0Tests manyToManyMapping.setSpecifiedTargetEntity("foo"); attributeNames = - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + manyToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertFalse(attributeNames.hasNext()); manyToManyMapping.setSpecifiedTargetEntity(null); attributeNames = - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + manyToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -556,8 +556,8 @@ public class GenericOrmManyToManyMapping2_0Tests OrmPersistentType printQueuePersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".PrintQueue"); OrmPersistentAttribute jobsPersistentAttribute = printQueuePersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "jobs"); OrmManyToManyMapping jobsMapping = (OrmManyToManyMapping) jobsPersistentAttribute.getMapping(); - jobsMapping.getRelationship().setMappedByJoiningStrategy(); - jobsMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute("queues"); + jobsMapping.getRelationship().setStrategyToMappedBy(); + jobsMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("queues"); OrmPersistentType printJobPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".PrintJob"); OrmPersistentAttribute queuesPersistentAttribute = printJobPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "queues"); @@ -604,7 +604,7 @@ public class GenericOrmManyToManyMapping2_0Tests assertEquals("MY_TABLE_OTHER_TABLE", jobsOrderColumn.getTable()); assertEquals("MY_TABLE_OTHER_TABLE", queuesOrderColumn.getTable()); - queuesMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE"); + queuesMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE"); assertEquals("MY_JOIN_TABLE", jobsOrderColumn.getTable()); assertEquals("MY_JOIN_TABLE", queuesOrderColumn.getTable()); } @@ -660,7 +660,7 @@ public class GenericOrmManyToManyMapping2_0Tests assertEquals("queues_ORDER", queuesOrderable.getOrderColumn().getName()); JavaManyToManyMapping javaQueuesManyToManyMapping = (JavaManyToManyMapping) queuesPersistentAttribute.getJavaPersistentAttribute().getMapping(); - javaQueuesManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("JOIN_TABLE"); + javaQueuesManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("JOIN_TABLE"); assertEquals("JOIN_TABLE", jobsOrderable.getOrderColumn().getTable()); assertEquals("FOO", jobsOrderable.getOrderColumn().getName()); assertEquals("JOIN_TABLE", queuesOrderable.getOrderColumn().getTable()); @@ -863,7 +863,7 @@ public class GenericOrmManyToManyMapping2_0Tests //set Column table element in Java JavaManyToManyMapping2_0 javaManyToManyMapping = (JavaManyToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping(); - javaManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE"); + javaManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE"); assertEquals("JAVA_JOIN_TABLE", column.getTable()); javaManyToManyMapping.getMapKeyColumn().setSpecifiedTable("JAVA_TABLE"); assertEquals("JAVA_TABLE", column.getTable()); @@ -889,7 +889,7 @@ public class GenericOrmManyToManyMapping2_0Tests assertEquals("address", virtualManyToManyMapping.getName()); assertEquals(FetchType.EAGER, virtualManyToManyMapping.getSpecifiedFetch()); assertEquals("Address", virtualManyToManyMapping.getSpecifiedTargetEntity()); - assertNull(virtualManyToManyMapping.getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + assertNull(virtualManyToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute()); Cascade2_0 cascade = (Cascade2_0) virtualManyToManyMapping.getCascade(); assertTrue(cascade.isAll()); @@ -923,7 +923,7 @@ public class GenericOrmManyToManyMapping2_0Tests assertEquals("address", ormManyToManyMapping.getName()); assertEquals(FetchType.LAZY, ormManyToManyMapping.getFetch()); assertEquals("test.Address", ormManyToManyMapping.getTargetEntity()); - assertNull(ormManyToManyMapping.getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + assertNull(ormManyToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute()); Cascade2_0 cascade = (Cascade2_0) ormManyToManyMapping.getCascade(); assertFalse(cascade.isAll()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/orm/GenericOrmManyToOneMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/orm/GenericOrmManyToOneMapping2_0Tests.java index ac9859b049..6136e0df2f 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/orm/GenericOrmManyToOneMapping2_0Tests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/orm/GenericOrmManyToOneMapping2_0Tests.java @@ -431,8 +431,8 @@ public class GenericOrmManyToOneMapping2_0Tests OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address"); JavaManyToOneMapping2_0 javaManyToOneMapping = ((JavaManyToOneMapping2_0) ormPersistentAttribute.getJavaPersistentAttribute().getMapping()); ManyToOneMapping2_0 virtualManyToOneMapping = (ManyToOneMapping2_0) ormPersistentAttribute.getMapping(); - ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).setJoinTableJoiningStrategy(); - JoinTable virtualJoinTable = ((ManyToOneRelationship2_0) virtualManyToOneMapping.getRelationship()).getJoinTableJoiningStrategy().getJoinTable(); + ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).setStrategyToJoinTable(); + JoinTable virtualJoinTable = ((ManyToOneRelationship2_0) virtualManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable(); assertTrue(ormPersistentAttribute.isVirtual()); assertEquals(null, virtualJoinTable.getSpecifiedName()); @@ -454,7 +454,7 @@ public class GenericOrmManyToOneMapping2_0Tests assertEquals("address_id", virtualInverseJoinColumn.getDefaultName()); assertEquals("id", virtualInverseJoinColumn.getDefaultReferencedColumnName()); - JavaJoinTable javaJoinTable = ((JavaManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).getJoinTableJoiningStrategy().getJoinTable(); + JavaJoinTable javaJoinTable = ((JavaManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable(); javaJoinTable.setSpecifiedName("FOO"); javaJoinTable.setSpecifiedCatalog("CATALOG"); javaJoinTable.setSpecifiedSchema("SCHEMA"); @@ -485,8 +485,8 @@ public class GenericOrmManyToOneMapping2_0Tests OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "address"); OrmManyToOneMapping2_0 ormManyToOneMapping = (OrmManyToOneMapping2_0) ormPersistentAttribute.getMapping(); - ((ManyToOneRelationship2_0) ormManyToOneMapping.getRelationship()).setJoinTableJoiningStrategy(); - OrmJoinTable ormJoinTable = ((OrmManyToOneRelationship2_0) ormManyToOneMapping.getRelationship()).getJoinTableJoiningStrategy().getJoinTable(); + ((ManyToOneRelationship2_0) ormManyToOneMapping.getRelationship()).setStrategyToJoinTable(); + OrmJoinTable ormJoinTable = ((OrmManyToOneRelationship2_0) ormManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable(); assertEquals(null, ormJoinTable.getDefaultName()); createTestTargetEntityAddress(); @@ -501,8 +501,8 @@ public class GenericOrmManyToOneMapping2_0Tests assertEquals("BAR_FOO", ormJoinTable.getDefaultName()); JavaManyToOneMapping2_0 javaManyToOneMapping = (JavaManyToOneMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("address").getMapping(); - ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).setJoinTableJoiningStrategy(); - ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE"); + ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).setStrategyToJoinTable(); + ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE"); assertEquals("BAR_FOO", ormJoinTable.getDefaultName()); @@ -519,15 +519,15 @@ public class GenericOrmManyToOneMapping2_0Tests //ormPersistentType.getMapping().setSpecifiedMetadataComplete(null); OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address"); ManyToOneMapping2_0 virtualManyToOneMapping = (ManyToOneMapping2_0) virtualPersistentAttribute.getMapping(); - JoinTable virtualJoinTable = ((ManyToOneRelationship2_0) virtualManyToOneMapping.getRelationship()).getJoinTableJoiningStrategy().getJoinTable(); + JoinTable virtualJoinTable = ((ManyToOneRelationship2_0) virtualManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable(); assertTrue(virtualPersistentAttribute.isVirtual()); assertEquals("JAVA_JOIN_TABLE", virtualJoinTable.getSpecifiedName());//specifiedName since this is a virtual mapping now - ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).getJoinTableJoiningStrategy().removeStrategy(); - virtualJoinTable = ((ManyToOneRelationship2_0) virtualManyToOneMapping.getRelationship()).getJoinTableJoiningStrategy().getJoinTable(); + ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).getJoinTableStrategy().removeStrategy(); + virtualJoinTable = ((ManyToOneRelationship2_0) virtualManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable(); assertNull(virtualJoinTable); - ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).setJoinTableJoiningStrategy(); - virtualJoinTable = ((ManyToOneRelationship2_0) virtualManyToOneMapping.getRelationship()).getJoinTableJoiningStrategy().getJoinTable(); + ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).setStrategyToJoinTable(); + virtualJoinTable = ((ManyToOneRelationship2_0) virtualManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable(); assertNull(virtualJoinTable.getSpecifiedName()); assertEquals("BAR_FOO", virtualJoinTable.getDefaultName()); @@ -549,26 +549,26 @@ public class GenericOrmManyToOneMapping2_0Tests assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); - rel.setJoinColumnJoiningStrategy(); + rel.setStrategyToJoinColumn(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); - rel.setJoinTableJoiningStrategy(); + rel.setStrategyToJoinTable(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNotNull(resourceMapping.getJoinTable()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); - rel.setJoinColumnJoiningStrategy(); + rel.setStrategyToJoinColumn(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); } public void testUpdatePredominantJoiningStrategy() throws Exception { @@ -582,29 +582,29 @@ public class GenericOrmManyToOneMapping2_0Tests assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); resourceMapping.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn()); getJpaProject().synchronizeContextModel(); assertFalse(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); resourceMapping.getJoinColumns().clear(); getJpaProject().synchronizeContextModel(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); resourceMapping.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable()); getJpaProject().synchronizeContextModel(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNotNull(resourceMapping.getJoinTable()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); } public void testVirtualMappingMetadataCompleteFalse() throws Exception { @@ -622,7 +622,7 @@ public class GenericOrmManyToOneMapping2_0Tests assertEquals(Boolean.FALSE, virtualManyToOneMapping.getSpecifiedOptional()); assertEquals("Address", virtualManyToOneMapping.getSpecifiedTargetEntity()); - JoinColumn virtualJoinColumn = virtualManyToOneMapping.getRelationship().getJoinColumnJoiningStrategy().specifiedJoinColumns().next(); + JoinColumn virtualJoinColumn = virtualManyToOneMapping.getRelationship().getJoinColumnStrategy().specifiedJoinColumns().next(); assertEquals("MY_COLUMN", virtualJoinColumn.getSpecifiedName()); assertEquals("MY_REFERENCED_COLUMN", virtualJoinColumn.getSpecifiedReferencedColumnName()); assertEquals(Boolean.TRUE, virtualJoinColumn.getSpecifiedUnique()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/orm/GenericOrmOneToManyMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/orm/GenericOrmOneToManyMapping2_0Tests.java index 58dbc3d60a..42ade62b0a 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/orm/GenericOrmOneToManyMapping2_0Tests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/orm/GenericOrmOneToManyMapping2_0Tests.java @@ -286,7 +286,7 @@ public class GenericOrmOneToManyMapping2_0Tests OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); Iterator attributeNames = - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -297,12 +297,12 @@ public class GenericOrmOneToManyMapping2_0Tests oneToManyMapping.setSpecifiedTargetEntity("foo"); attributeNames = - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertFalse(attributeNames.hasNext()); oneToManyMapping.setSpecifiedTargetEntity(null); attributeNames = - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -332,7 +332,7 @@ public class GenericOrmOneToManyMapping2_0Tests OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping(); Iterator attributeNames = - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -343,12 +343,12 @@ public class GenericOrmOneToManyMapping2_0Tests oneToManyMapping.setSpecifiedTargetEntity("foo"); attributeNames = - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertFalse(attributeNames.hasNext()); oneToManyMapping.setSpecifiedTargetEntity(null); attributeNames = - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -635,8 +635,8 @@ public class GenericOrmOneToManyMapping2_0Tests getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".PrintJob"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "jobs"); OrmOneToManyMapping oneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping(); - oneToManyMapping.getRelationship().setMappedByJoiningStrategy(); - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute("queue"); + oneToManyMapping.getRelationship().setStrategyToMappedBy(); + oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("queue"); Orderable2_0 orderable = ((Orderable2_0) oneToManyMapping.getOrderable()); assertEquals(false, orderable.isOrderColumnOrdering()); @@ -887,7 +887,7 @@ public class GenericOrmOneToManyMapping2_0Tests //set Column table element in Java JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping(); - javaOneToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE"); + javaOneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE"); assertEquals("JAVA_JOIN_TABLE", virtualColumn.getTable()); javaOneToManyMapping.getMapKeyColumn().setSpecifiedTable("JAVA_TABLE"); assertEquals("JAVA_TABLE", virtualColumn.getTable()); @@ -912,33 +912,33 @@ public class GenericOrmOneToManyMapping2_0Tests assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); - rel.setJoinColumnJoiningStrategy(); + rel.setStrategyToJoinColumn(); assertFalse(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); - rel.setMappedByJoiningStrategy(); + rel.setStrategyToMappedBy(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); assertNotNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); - rel.setJoinTableJoiningStrategy(); + rel.setStrategyToJoinTable(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); } public void testUpdatePredominantJoiningStrategy() throws Exception { @@ -953,63 +953,63 @@ public class GenericOrmOneToManyMapping2_0Tests assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); resourceMapping.setMappedBy("foo"); getJpaProject().synchronizeContextModel(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); assertNotNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); resourceMapping.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable()); getJpaProject().synchronizeContextModel(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNotNull(resourceMapping.getJoinTable()); assertNotNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); resourceMapping.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn()); getJpaProject().synchronizeContextModel(); assertFalse(resourceMapping.getJoinColumns().isEmpty()); assertNotNull(resourceMapping.getJoinTable()); assertNotNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); resourceMapping.setMappedBy(null); getJpaProject().synchronizeContextModel(); assertFalse(resourceMapping.getJoinColumns().isEmpty()); assertNotNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); resourceMapping.setJoinTable(null); getJpaProject().synchronizeContextModel(); assertFalse(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); resourceMapping.getJoinColumns().clear(); getJpaProject().synchronizeContextModel(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); } public void testTargetForeignKeyJoinColumnStrategy() throws Exception { @@ -1023,9 +1023,9 @@ public class GenericOrmOneToManyMapping2_0Tests OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping(); JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getJavaPersistentAttribute().getMapping(); OneToManyRelationship2_0 rr = (OneToManyRelationship2_0) javaOneToManyMapping.getRelationship(); - rr.setJoinColumnJoiningStrategy(); + rr.setStrategyToJoinColumn(); - JoinColumn joinColumn = rr.getJoinColumnJoiningStrategy().joinColumns().next(); + JoinColumn joinColumn = rr.getJoinColumnStrategy().joinColumns().next(); assertTrue(persistentAttribute.isVirtual()); assertEquals("addresses_id", joinColumn.getDefaultName()); assertEquals("Address", joinColumn.getDefaultTable());//target table name @@ -1040,10 +1040,10 @@ public class GenericOrmOneToManyMapping2_0Tests oneToManyMapping = (OrmOneToManyMapping2_0) persistentAttribute.getMapping(); assertFalse(persistentAttribute.isVirtual()); rr = (OneToManyRelationship2_0) oneToManyMapping.getRelationship(); - assertFalse(rr.usesJoinColumnJoiningStrategy()); + assertFalse(rr.strategyIsJoinColumn()); - rr.setJoinColumnJoiningStrategy(); - joinColumn = rr.getJoinColumnJoiningStrategy().specifiedJoinColumns().next(); + rr.setStrategyToJoinColumn(); + joinColumn = rr.getJoinColumnStrategy().specifiedJoinColumns().next(); assertFalse(persistentAttribute.isVirtual()); assertEquals("addresses_id", joinColumn.getDefaultName()); assertEquals("ADDRESS_PRIMARY_TABLE", joinColumn.getDefaultTable());//target table name @@ -1070,7 +1070,7 @@ public class GenericOrmOneToManyMapping2_0Tests OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping(); JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getJavaPersistentAttribute().getMapping(); OneToManyRelationship2_0 rr = (OneToManyRelationship2_0) javaOneToManyMapping.getRelationship(); - rr.setJoinColumnJoiningStrategy(); + rr.setStrategyToJoinColumn(); assertTrue(persistentAttribute.isVirtual()); assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getName()); @@ -1098,9 +1098,9 @@ public class GenericOrmOneToManyMapping2_0Tests oneToManyMapping = (OrmOneToManyMapping2_0) persistentAttribute.getMapping(); assertFalse(persistentAttribute.isVirtual()); rr = (OneToManyRelationship2_0) oneToManyMapping.getRelationship(); - assertFalse(rr.usesJoinColumnJoiningStrategy()); + assertFalse(rr.strategyIsJoinColumn()); - rr.setJoinColumnJoiningStrategy(); + rr.setStrategyToJoinColumn(); assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getName()); assertEquals("ADDRESS_PRIMARY_TABLE", oneToManyMapping.getMapKeyColumn().getTable());//target table name @@ -1127,7 +1127,7 @@ public class GenericOrmOneToManyMapping2_0Tests OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping(); JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getJavaPersistentAttribute().getMapping(); OneToManyRelationship2_0 rr = (OneToManyRelationship2_0) javaOneToManyMapping.getRelationship(); - rr.setJoinColumnJoiningStrategy(); + rr.setStrategyToJoinColumn(); ((Orderable2_0) javaOneToManyMapping.getOrderable()).setOrderColumnOrdering(true); OrderColumn2_0 orderColumn = ((Orderable2_0) oneToManyMapping.getOrderable()).getOrderColumn(); @@ -1145,9 +1145,9 @@ public class GenericOrmOneToManyMapping2_0Tests oneToManyMapping = (OrmOneToManyMapping2_0) persistentAttribute.getMapping(); assertFalse(persistentAttribute.isVirtual()); rr = (OneToManyRelationship2_0) oneToManyMapping.getRelationship(); - assertFalse(rr.usesJoinColumnJoiningStrategy()); + assertFalse(rr.strategyIsJoinColumn()); - rr.setJoinColumnJoiningStrategy(); + rr.setStrategyToJoinColumn(); assertFalse(((Orderable2_0) oneToManyMapping.getOrderable()).isOrderColumnOrdering()); ((Orderable2_0) oneToManyMapping.getOrderable()).setOrderColumnOrdering(true); orderColumn = ((Orderable2_0) oneToManyMapping.getOrderable()).getOrderColumn(); @@ -1176,7 +1176,7 @@ public class GenericOrmOneToManyMapping2_0Tests assertEquals(FetchType.EAGER, virtualOneToManyMapping.getSpecifiedFetch()); assertEquals("Address", virtualOneToManyMapping.getSpecifiedTargetEntity()); assertNull(virtualOneToManyMapping.getRelationship(). - getMappedByJoiningStrategy().getMappedByAttribute()); + getMappedByStrategy().getMappedByAttribute()); Cascade2_0 cascade = (Cascade2_0) virtualOneToManyMapping.getCascade(); assertTrue(cascade.isAll()); @@ -1212,7 +1212,7 @@ public class GenericOrmOneToManyMapping2_0Tests assertEquals("address", ormOneToManyMapping.getName()); assertEquals(FetchType.LAZY, ormOneToManyMapping.getFetch()); assertEquals("test.Address", ormOneToManyMapping.getTargetEntity()); - assertNull(ormOneToManyMapping.getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + assertNull(ormOneToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute()); Cascade2_0 cascade = (Cascade2_0) ormOneToManyMapping.getCascade(); assertFalse(cascade.isAll()); diff --git a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/orm/GenericOrmOneToOneMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/orm/GenericOrmOneToOneMapping2_0Tests.java index e4cefee064..8aea0e0a8e 100644 --- a/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/orm/GenericOrmOneToOneMapping2_0Tests.java +++ b/jpa/tests/org.eclipse.jpt.core.tests/src/org/eclipse/jpt/core/tests/internal/jpa2/context/orm/GenericOrmOneToOneMapping2_0Tests.java @@ -504,7 +504,7 @@ public class GenericOrmOneToOneMapping2_0Tests OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); Iterator attributeNames = - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToOneMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -515,12 +515,12 @@ public class GenericOrmOneToOneMapping2_0Tests oneToOneMapping.setSpecifiedTargetEntity("foo"); attributeNames = - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToOneMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertFalse(attributeNames.hasNext()); oneToOneMapping.setSpecifiedTargetEntity(null); attributeNames = - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToOneMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -549,7 +549,7 @@ public class GenericOrmOneToOneMapping2_0Tests ReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.attributes().next(); OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); - Iterator attributeNames = oneToOneMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + Iterator attributeNames = oneToOneMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -560,12 +560,12 @@ public class GenericOrmOneToOneMapping2_0Tests oneToOneMapping.setSpecifiedTargetEntity("foo"); attributeNames = - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToOneMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertFalse(attributeNames.hasNext()); oneToOneMapping.setSpecifiedTargetEntity(null); attributeNames = - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToOneMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -629,8 +629,8 @@ public class GenericOrmOneToOneMapping2_0Tests OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address"); JavaOneToOneMapping2_0 javaOneToOneMapping = ((JavaOneToOneMapping2_0) ormPersistentAttribute.getJavaPersistentAttribute().getMapping()); JavaOneToOneMapping2_0 virtualOneToOneMapping = (JavaOneToOneMapping2_0) ormPersistentAttribute.getMapping(); - ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).setJoinTableJoiningStrategy(); - JoinTable virtualJoinTable = ((OneToOneRelationship2_0) virtualOneToOneMapping.getRelationship()).getJoinTableJoiningStrategy().getJoinTable(); + ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).setStrategyToJoinTable(); + JoinTable virtualJoinTable = ((OneToOneRelationship2_0) virtualOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable(); assertTrue(ormPersistentAttribute.isVirtual()); assertEquals(null, virtualJoinTable.getSpecifiedName()); @@ -653,7 +653,7 @@ public class GenericOrmOneToOneMapping2_0Tests assertEquals("address_id", inverseOrmJoinColumn.getDefaultName()); assertEquals("id", inverseOrmJoinColumn.getDefaultReferencedColumnName()); - JavaJoinTable javaJoinTable = ((JavaOneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).getJoinTableJoiningStrategy().getJoinTable(); + JavaJoinTable javaJoinTable = ((JavaOneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable(); javaJoinTable.setSpecifiedName("FOO"); javaJoinTable.setSpecifiedCatalog("CATALOG"); javaJoinTable.setSpecifiedSchema("SCHEMA"); @@ -684,8 +684,8 @@ public class GenericOrmOneToOneMapping2_0Tests OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "address"); OrmOneToOneMapping2_0 ormOneToOneMapping = (OrmOneToOneMapping2_0) ormPersistentAttribute.getMapping(); - ((OneToOneRelationship2_0) ormOneToOneMapping.getRelationship()).setJoinTableJoiningStrategy(); - OrmJoinTable ormJoinTable = ((OrmOneToOneRelationship2_0) ormOneToOneMapping.getRelationship()).getJoinTableJoiningStrategy().getJoinTable(); + ((OneToOneRelationship2_0) ormOneToOneMapping.getRelationship()).setStrategyToJoinTable(); + OrmJoinTable ormJoinTable = ((OrmOneToOneRelationship2_0) ormOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable(); assertEquals(null, ormJoinTable.getDefaultName()); createTestTargetEntityAddress(); @@ -700,8 +700,8 @@ public class GenericOrmOneToOneMapping2_0Tests assertEquals("BAR_FOO", ormJoinTable.getDefaultName()); JavaOneToOneMapping2_0 javaOneToOneMapping = (JavaOneToOneMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("address").getMapping(); - ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).setJoinTableJoiningStrategy(); - ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE"); + ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).setStrategyToJoinTable(); + ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE"); assertEquals("BAR_FOO", ormJoinTable.getDefaultName()); @@ -718,15 +718,15 @@ public class GenericOrmOneToOneMapping2_0Tests //ormPersistentType.getMapping().setSpecifiedMetadataComplete(null); OrmReadOnlyPersistentAttribute virtualAttribute = ormPersistentType.getAttributeNamed("address"); OneToOneMapping2_0 virtualOneToOneMapping = (OneToOneMapping2_0) virtualAttribute.getMapping(); - JoinTable virtualJoinTable = ((OneToOneRelationship2_0) virtualOneToOneMapping.getRelationship()).getJoinTableJoiningStrategy().getJoinTable(); + JoinTable virtualJoinTable = ((OneToOneRelationship2_0) virtualOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable(); assertTrue(virtualAttribute.isVirtual()); assertEquals("JAVA_JOIN_TABLE", virtualJoinTable.getSpecifiedName());//specifiedName since this is a virtual mapping now - ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).getJoinTableJoiningStrategy().removeStrategy(); - virtualJoinTable = ((OneToOneRelationship2_0) virtualOneToOneMapping.getRelationship()).getJoinTableJoiningStrategy().getJoinTable(); + ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).getJoinTableStrategy().removeStrategy(); + virtualJoinTable = ((OneToOneRelationship2_0) virtualOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable(); assertNull(virtualJoinTable); - ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).setJoinTableJoiningStrategy(); - virtualJoinTable = ((OneToOneRelationship2_0) virtualOneToOneMapping.getRelationship()).getJoinTableJoiningStrategy().getJoinTable(); + ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).setStrategyToJoinTable(); + virtualJoinTable = ((OneToOneRelationship2_0) virtualOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable(); assertEquals("BAR_FOO", virtualJoinTable.getName()); assertNull(virtualJoinTable.getSpecifiedName()); assertEquals("BAR_FOO", virtualJoinTable.getDefaultName()); @@ -751,50 +751,50 @@ public class GenericOrmOneToOneMapping2_0Tests assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNull(resourceMapping.getMappedBy()); assertNull(resourceMapping.getJoinTable()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); - rel.setMappedByJoiningStrategy(); + rel.setStrategyToMappedBy(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNotNull(resourceMapping.getMappedBy()); assertNull(resourceMapping.getJoinTable()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertTrue(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); - rel.setPrimaryKeyJoinColumnJoiningStrategy(); + rel.setStrategyToPrimaryKeyJoinColumn(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNull(resourceMapping.getMappedBy()); assertNull(resourceMapping.getJoinTable()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); - rel.setJoinTableJoiningStrategy(); + rel.setStrategyToJoinTable(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNull(resourceMapping.getMappedBy()); assertNotNull(resourceMapping.getJoinTable()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertTrue(rel.strategyIsJoinTable()); - rel.setJoinColumnJoiningStrategy(); + rel.setStrategyToJoinColumn(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNull(resourceMapping.getMappedBy()); assertNull(resourceMapping.getJoinTable()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); } public void testUpdatePredominantJoiningStrategy() throws Exception { @@ -810,10 +810,10 @@ public class GenericOrmOneToOneMapping2_0Tests assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNull(resourceMapping.getMappedBy()); assertNull(resourceMapping.getJoinTable()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); resourceMapping.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumn()); getJpaProject().synchronizeContextModel(); @@ -821,10 +821,10 @@ public class GenericOrmOneToOneMapping2_0Tests assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNull(resourceMapping.getMappedBy()); assertNull(resourceMapping.getJoinTable()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); resourceMapping.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn()); getJpaProject().synchronizeContextModel(); @@ -832,10 +832,10 @@ public class GenericOrmOneToOneMapping2_0Tests assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNull(resourceMapping.getMappedBy()); assertNull(resourceMapping.getJoinTable()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); resourceMapping.setMappedBy("foo"); getJpaProject().synchronizeContextModel(); @@ -843,10 +843,10 @@ public class GenericOrmOneToOneMapping2_0Tests assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNotNull(resourceMapping.getMappedBy()); assertNull(resourceMapping.getJoinTable()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertTrue(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); resourceMapping.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable()); getJpaProject().synchronizeContextModel(); @@ -854,10 +854,10 @@ public class GenericOrmOneToOneMapping2_0Tests assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNotNull(resourceMapping.getMappedBy()); assertNotNull(resourceMapping.getJoinTable()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertTrue(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); resourceMapping.getPrimaryKeyJoinColumns().clear(); getJpaProject().synchronizeContextModel(); @@ -865,10 +865,10 @@ public class GenericOrmOneToOneMapping2_0Tests assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNotNull(resourceMapping.getMappedBy()); assertNotNull(resourceMapping.getJoinTable()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertTrue(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); resourceMapping.getJoinColumns().clear(); getJpaProject().synchronizeContextModel(); @@ -876,10 +876,10 @@ public class GenericOrmOneToOneMapping2_0Tests assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNotNull(resourceMapping.getMappedBy()); assertNotNull(resourceMapping.getJoinTable()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertTrue(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); resourceMapping.setMappedBy(null); getJpaProject().synchronizeContextModel(); @@ -887,10 +887,10 @@ public class GenericOrmOneToOneMapping2_0Tests assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNull(resourceMapping.getMappedBy()); assertNotNull(resourceMapping.getJoinTable()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertTrue(rel.strategyIsJoinTable()); resourceMapping.setJoinTable(null); getJpaProject().synchronizeContextModel(); @@ -898,10 +898,10 @@ public class GenericOrmOneToOneMapping2_0Tests assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNull(resourceMapping.getMappedBy()); assertNull(resourceMapping.getJoinTable()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); } public void testVirtualMappingMetadataCompleteFalse() throws Exception { @@ -919,10 +919,10 @@ public class GenericOrmOneToOneMapping2_0Tests assertEquals(Boolean.FALSE, virtualOneToOneMapping.getSpecifiedOptional()); assertEquals("Address", virtualOneToOneMapping.getSpecifiedTargetEntity()); assertNull(virtualOneToOneMapping.getRelationship(). - getMappedByJoiningStrategy().getMappedByAttribute()); + getMappedByStrategy().getMappedByAttribute()); JoinColumn virtualJoinColumn = - virtualOneToOneMapping.getRelationship().getJoinColumnJoiningStrategy().specifiedJoinColumns().next(); + virtualOneToOneMapping.getRelationship().getJoinColumnStrategy().specifiedJoinColumns().next(); assertEquals("MY_COLUMN", virtualJoinColumn.getSpecifiedName()); assertEquals("MY_REFERENCED_COLUMN", virtualJoinColumn.getSpecifiedReferencedColumnName()); assertEquals(Boolean.TRUE, virtualJoinColumn.getSpecifiedUnique()); @@ -964,7 +964,7 @@ public class GenericOrmOneToOneMapping2_0Tests assertEquals(FetchType.EAGER, ormOneToOneMapping.getFetch()); assertEquals(true, ormOneToOneMapping.isOptional()); assertEquals("test.Address", ormOneToOneMapping.getTargetEntity()); - assertNull(ormOneToOneMapping.getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + assertNull(ormOneToOneMapping.getRelationship().getMappedByStrategy().getMappedByAttribute()); //TODO default join columns in xml one-to-one // XmlJoinColumn ormJoinColumn = ormOneToOneMapping.specifiedJoinColumns().next(); diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToManyMappingTests.java index e6ea1c83c1..ec952c1c61 100644 --- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToManyMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToManyMappingTests.java @@ -281,33 +281,33 @@ public class EclipseLinkJavaOneToManyMappingTests extends EclipseLinkContextMode assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); - rel.setJoinColumnJoiningStrategy(); + rel.setStrategyToJoinColumn(); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); - rel.setMappedByJoiningStrategy(); + rel.setStrategyToMappedBy(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNotNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); - rel.setJoinTableJoiningStrategy(); + rel.setStrategyToJoinTable(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); } public void testUpdatePredominantJoiningStrategy() throws Exception { @@ -323,63 +323,63 @@ public class EclipseLinkJavaOneToManyMappingTests extends EclipseLinkContextMode assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); annotation.setMappedBy("foo"); getJpaProject().synchronizeContextModel(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNotNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); resourceAttribute.addAnnotation(JPA.JOIN_TABLE); getJpaProject().synchronizeContextModel(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNotNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); resourceAttribute.addAnnotation(JPA.JOIN_COLUMN); getJpaProject().synchronizeContextModel(); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNotNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); annotation.setMappedBy(null); getJpaProject().synchronizeContextModel(); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); resourceAttribute.removeAnnotation(JPA.JOIN_TABLE); getJpaProject().synchronizeContextModel(); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); resourceAttribute.removeAnnotation(JPA.JOIN_COLUMN); getJpaProject().synchronizeContextModel(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); } public void testDefaultOneToMany() throws Exception { @@ -450,10 +450,10 @@ public class EclipseLinkJavaOneToManyMappingTests extends EclipseLinkContextMode assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey()); EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping(); - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute("Foo"); + oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("Foo"); EclipseLinkOneToManyMapping specifiedOneToManyMapping = (EclipseLinkOneToManyMapping) getJavaPersistentType().attributes().next().getMapping(); - assertEquals("Foo", specifiedOneToManyMapping.getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + assertEquals("Foo", specifiedOneToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute()); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToOneMappingTests.java index da0ca8c1f6..5996b1eddc 100644 --- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToOneMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToOneMappingTests.java @@ -319,10 +319,10 @@ public class EclipseLinkJavaOneToOneMappingTests extends EclipseLinkContextModel assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey()); EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping(); - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute("Foo"); + oneToOneMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("Foo"); EclipseLinkOneToOneMapping specifiedOneToOneMapping = (EclipseLinkOneToOneMapping) getJavaPersistentType().attributes().next().getMapping(); - assertEquals("Foo", specifiedOneToOneMapping.getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + assertEquals("Foo", specifiedOneToOneMapping.getRelationship().getMappedByStrategy().getMappedByAttribute()); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); JavaResourcePersistentAttribute attributeResource = typeResource.persistableAttributes().next(); diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToManyMappingTests.java index 40b0a23226..c964f8fd91 100644 --- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToManyMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToManyMappingTests.java @@ -270,7 +270,7 @@ public class EclipseLinkOrmManyToManyMappingTests ManyToManyMapping manyToMany = (ManyToManyMapping) attribute.getMapping(); assertEquals(true, attribute.isVirtual()); - JoinTable ormJoinTable = manyToMany.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JoinTable ormJoinTable = manyToMany.getRelationship().getJoinTableStrategy().getJoinTable(); assertEquals("DEP_EMP", ormJoinTable.getName()); assertEquals("DEPT_ID", ormJoinTable.specifiedJoinColumns().next().getName()); assertEquals("id", ormJoinTable.specifiedJoinColumns().next().getReferencedColumnName()); @@ -284,7 +284,7 @@ public class EclipseLinkOrmManyToManyMappingTests OneToManyMapping oneToMany = (OneToManyMapping) attribute.getMapping(); assertEquals(true, attribute.isVirtual()); - ormJoinTable = oneToMany.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + ormJoinTable = oneToMany.getRelationship().getJoinTableStrategy().getJoinTable(); assertEquals("Department_Employee", ormJoinTable.getName()); assertEquals("Department_id", ormJoinTable.getDefaultJoinColumn().getName()); assertEquals("id", ormJoinTable.getDefaultJoinColumn().getReferencedColumnName()); @@ -296,7 +296,7 @@ public class EclipseLinkOrmManyToManyMappingTests attribute = departmentPersistentType.getAttributeNamed("employees"); manyToMany = (ManyToManyMapping) attribute.getMapping(); assertEquals(true, attribute.isVirtual()); - ormJoinTable = manyToMany.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + ormJoinTable = manyToMany.getRelationship().getJoinTableStrategy().getJoinTable(); assertEquals("DEP_EMP", ormJoinTable.getName()); assertEquals("DEPT_ID", ormJoinTable.specifiedJoinColumns().next().getName()); assertEquals("id", ormJoinTable.specifiedJoinColumns().next().getReferencedColumnName()); @@ -308,7 +308,7 @@ public class EclipseLinkOrmManyToManyMappingTests attribute = departmentPersistentType.getAttributeNamed("employees"); manyToMany = (ManyToManyMapping) attribute.getMapping(); assertEquals(false, attribute.isVirtual()); - ormJoinTable = manyToMany.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + ormJoinTable = manyToMany.getRelationship().getJoinTableStrategy().getJoinTable(); assertEquals("Department_Employee", ormJoinTable.getName()); assertEquals(0, ormJoinTable.specifiedJoinColumnsSize()); assertEquals("Department_id", ormJoinTable.getDefaultJoinColumn().getName()); @@ -332,7 +332,7 @@ public class EclipseLinkOrmManyToManyMappingTests assertEquals(FetchType.EAGER, virtualManyToManyMapping.getSpecifiedFetch()); assertEquals("Address", virtualManyToManyMapping.getSpecifiedTargetEntity()); assertNull(virtualManyToManyMapping.getRelationship(). - getMappedByJoiningStrategy().getMappedByAttribute()); + getMappedByStrategy().getMappedByAttribute()); Cascade cascade = virtualManyToManyMapping.getCascade(); assertTrue(cascade.isAll()); @@ -366,7 +366,7 @@ public class EclipseLinkOrmManyToManyMappingTests assertEquals("address", ormManyToManyMapping.getName()); assertEquals(FetchType.LAZY, ormManyToManyMapping.getFetch()); assertEquals("test.Address", ormManyToManyMapping.getTargetEntity()); - assertNull(ormManyToManyMapping.getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + assertNull(ormManyToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute()); Cascade cascade = ormManyToManyMapping.getCascade(); assertFalse(cascade.isAll()); diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToOneMappingTests.java index 57d077eae5..79e60985c8 100644 --- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToOneMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToOneMappingTests.java @@ -269,7 +269,7 @@ public class EclipseLinkOrmManyToOneMappingTests assertEquals(Boolean.FALSE, virtualManyToOneMapping.getSpecifiedOptional()); assertEquals("Address", virtualManyToOneMapping.getSpecifiedTargetEntity()); - JoinColumn virtualJoinColumn = virtualManyToOneMapping.getRelationship().getJoinColumnJoiningStrategy().specifiedJoinColumns().next(); + JoinColumn virtualJoinColumn = virtualManyToOneMapping.getRelationship().getJoinColumnStrategy().specifiedJoinColumns().next(); assertEquals("MY_COLUMN", virtualJoinColumn.getSpecifiedName()); assertEquals("MY_REFERENCED_COLUMN", virtualJoinColumn.getSpecifiedReferencedColumnName()); assertEquals(Boolean.TRUE, virtualJoinColumn.getSpecifiedUnique()); diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToManyMappingTests.java index a17d7a4e9c..538eddea0b 100644 --- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToManyMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToManyMappingTests.java @@ -420,7 +420,7 @@ public class EclipseLinkOrmOneToManyMappingTests OneToManyMapping oneToMany = (OneToManyMapping) attribute.getMapping(); assertEquals(true, attribute.isVirtual()); - JoinTable ormJoinTable = oneToMany.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + JoinTable ormJoinTable = oneToMany.getRelationship().getJoinTableStrategy().getJoinTable(); assertEquals("DEP_EMP", ormJoinTable.getName()); assertEquals("DEPT_ID", ormJoinTable.specifiedJoinColumns().next().getName()); assertEquals("id", ormJoinTable.specifiedJoinColumns().next().getReferencedColumnName()); @@ -434,7 +434,7 @@ public class EclipseLinkOrmOneToManyMappingTests oneToMany = (OneToManyMapping) attribute.getMapping(); assertEquals(true, attribute.isVirtual()); - ormJoinTable = oneToMany.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + ormJoinTable = oneToMany.getRelationship().getJoinTableStrategy().getJoinTable(); assertEquals("Department_Employee", ormJoinTable.getName()); assertEquals("Department_id", ormJoinTable.getDefaultJoinColumn().getName()); assertEquals("id", ormJoinTable.getDefaultJoinColumn().getReferencedColumnName()); @@ -446,7 +446,7 @@ public class EclipseLinkOrmOneToManyMappingTests attribute = departmentPersistentType.getAttributeNamed("employees"); oneToMany = (OneToManyMapping) attribute.getMapping(); assertEquals(true, attribute.isVirtual()); - ormJoinTable = oneToMany.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + ormJoinTable = oneToMany.getRelationship().getJoinTableStrategy().getJoinTable(); assertEquals("DEP_EMP", ormJoinTable.getName()); assertEquals("DEPT_ID", ormJoinTable.specifiedJoinColumns().next().getName()); assertEquals("id", ormJoinTable.specifiedJoinColumns().next().getReferencedColumnName()); @@ -458,7 +458,7 @@ public class EclipseLinkOrmOneToManyMappingTests attribute = departmentPersistentType.getAttributeNamed("employees"); oneToMany = (OneToManyMapping) attribute.getMapping(); assertEquals(false, attribute.isVirtual()); - ormJoinTable = oneToMany.getRelationship().getJoinTableJoiningStrategy().getJoinTable(); + ormJoinTable = oneToMany.getRelationship().getJoinTableStrategy().getJoinTable(); assertEquals("Department_Employee", ormJoinTable.getName()); assertEquals(0, ormJoinTable.specifiedJoinColumnsSize()); assertEquals("Department_id", ormJoinTable.getDefaultJoinColumn().getName()); @@ -585,33 +585,33 @@ public class EclipseLinkOrmOneToManyMappingTests assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); - rel.setJoinColumnJoiningStrategy(); + rel.setStrategyToJoinColumn(); assertFalse(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); - rel.setMappedByJoiningStrategy(); + rel.setStrategyToMappedBy(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); assertNotNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); - rel.setJoinTableJoiningStrategy(); + rel.setStrategyToJoinTable(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); } public void testUpdatePredominantJoiningStrategy() throws Exception { @@ -626,63 +626,63 @@ public class EclipseLinkOrmOneToManyMappingTests assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); resourceMapping.setMappedBy("foo"); getJpaProject().synchronizeContextModel(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); assertNotNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); resourceMapping.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable()); getJpaProject().synchronizeContextModel(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNotNull(resourceMapping.getJoinTable()); assertNotNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); resourceMapping.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn()); getJpaProject().synchronizeContextModel(); assertFalse(resourceMapping.getJoinColumns().isEmpty()); assertNotNull(resourceMapping.getJoinTable()); assertNotNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); resourceMapping.setMappedBy(null); getJpaProject().synchronizeContextModel(); assertFalse(resourceMapping.getJoinColumns().isEmpty()); assertNotNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); resourceMapping.setJoinTable(null); getJpaProject().synchronizeContextModel(); assertFalse(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); resourceMapping.getJoinColumns().clear(); getJpaProject().synchronizeContextModel(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); } public void testVirtualMappingMetadataCompleteFalse() throws Exception { @@ -699,7 +699,7 @@ public class EclipseLinkOrmOneToManyMappingTests assertEquals(FetchType.EAGER, virtualOneToManyMapping.getSpecifiedFetch()); assertEquals("Address", virtualOneToManyMapping.getSpecifiedTargetEntity()); assertNull(virtualOneToManyMapping.getRelationship(). - getMappedByJoiningStrategy().getMappedByAttribute()); + getMappedByStrategy().getMappedByAttribute()); Cascade cascade = virtualOneToManyMapping.getCascade(); assertTrue(cascade.isAll()); @@ -730,7 +730,7 @@ public class EclipseLinkOrmOneToManyMappingTests assertEquals("address", virtualOneToManyMapping.getName()); assertEquals(FetchType.LAZY, virtualOneToManyMapping.getFetch()); assertEquals("test.Address", virtualOneToManyMapping.getTargetEntity()); - assertNull(virtualOneToManyMapping.getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + assertNull(virtualOneToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute()); Cascade cascade = virtualOneToManyMapping.getCascade(); assertFalse(cascade.isAll()); diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToOneMappingTests.java index afbc7dd61c..8ec5b85146 100644 --- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToOneMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToOneMappingTests.java @@ -329,10 +329,10 @@ public class EclipseLinkOrmOneToOneMappingTests assertEquals(Boolean.FALSE, virtualOneToOneMapping.getSpecifiedOptional()); assertEquals("Address", virtualOneToOneMapping.getSpecifiedTargetEntity()); assertNull(virtualOneToOneMapping.getRelationship(). - getMappedByJoiningStrategy().getMappedByAttribute()); + getMappedByStrategy().getMappedByAttribute()); JoinColumn virtualJoinColumn = - virtualOneToOneMapping.getRelationship().getJoinColumnJoiningStrategy().specifiedJoinColumns().next(); + virtualOneToOneMapping.getRelationship().getJoinColumnStrategy().specifiedJoinColumns().next(); assertEquals("MY_COLUMN", virtualJoinColumn.getSpecifiedName()); assertEquals("MY_REFERENCED_COLUMN", virtualJoinColumn.getSpecifiedReferencedColumnName()); assertEquals(Boolean.TRUE, virtualJoinColumn.getSpecifiedUnique()); @@ -371,7 +371,7 @@ public class EclipseLinkOrmOneToOneMappingTests assertEquals(FetchType.EAGER, ormOneToOneMapping.getFetch()); assertEquals(true, ormOneToOneMapping.isOptional()); assertEquals("test.Address", ormOneToOneMapping.getTargetEntity()); - assertNull(ormOneToOneMapping.getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + assertNull(ormOneToOneMapping.getRelationship().getMappedByStrategy().getMappedByAttribute()); //TODO default join columns in xml one-to-one // XmlJoinColumn ormJoinColumn = ormOneToOneMapping.specifiedJoinColumns().next(); @@ -413,13 +413,13 @@ public class EclipseLinkOrmOneToOneMappingTests assertNull(ormOneToOneMapping.getSpecifiedFetch()); assertNull(ormOneToOneMapping.getSpecifiedOptional()); assertNull(ormOneToOneMapping.getSpecifiedTargetEntity()); - assertNull(ormOneToOneMapping.getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + assertNull(ormOneToOneMapping.getRelationship().getMappedByStrategy().getMappedByAttribute()); assertEquals(FetchType.EAGER, ormOneToOneMapping.getFetch()); assertEquals(true, ormOneToOneMapping.isOptional()); //TODO default target entity in xml //assertEquals("test.Address", ormOneToOneMapping.getDefaultTargetEntity()); - assertTrue(ormOneToOneMapping.getRelationship().getJoinColumnJoiningStrategy().joinColumnsSize() > 0); + assertTrue(ormOneToOneMapping.getRelationship().getJoinColumnStrategy().joinColumnsSize() > 0); //TODO default join columns for specified xmlOneToOne mapping // XmlJoinColumn ormJoinColumn = ormOneToOneMapping.defaultJoinColumns().next(); diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaManyToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaManyToManyMappingTests.java index 27530a70f7..cb3499eb33 100644 --- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaManyToManyMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaManyToManyMappingTests.java @@ -442,7 +442,7 @@ public class EclipseLink2_0JavaManyToManyMappingTests ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); Iterator attributeNames = - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + manyToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -454,12 +454,12 @@ public class EclipseLink2_0JavaManyToManyMappingTests manyToManyMapping.setSpecifiedTargetEntity("foo"); attributeNames = - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + manyToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertFalse(attributeNames.hasNext()); manyToManyMapping.setSpecifiedTargetEntity(null); attributeNames = - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + manyToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -485,7 +485,7 @@ public class EclipseLink2_0JavaManyToManyMappingTests ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); Iterator attributeNames = - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + manyToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -496,12 +496,12 @@ public class EclipseLink2_0JavaManyToManyMappingTests manyToManyMapping.setSpecifiedTargetEntity("foo"); attributeNames = - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + manyToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertFalse(attributeNames.hasNext()); manyToManyMapping.setSpecifiedTargetEntity(null); attributeNames = - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + manyToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -778,7 +778,7 @@ public class EclipseLink2_0JavaManyToManyMappingTests assertEquals("MY_TABLE_OTHER_TABLE", jobsOrderColumn.getTable()); assertEquals("MY_TABLE_OTHER_TABLE", queuesOrderColumn.getTable()); - queuesMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE"); + queuesMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE"); assertEquals("MY_JOIN_TABLE", jobsOrderColumn.getTable()); assertEquals("MY_JOIN_TABLE", queuesOrderColumn.getTable()); } @@ -867,8 +867,8 @@ public class EclipseLink2_0JavaManyToManyMappingTests PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping(); - manyToManyMapping.getRelationship().setMappedByJoiningStrategy(); - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute("employees"); + manyToManyMapping.getRelationship().setStrategyToMappedBy(); + manyToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("employees"); assertNull(manyToManyMapping.getMapKeyColumn().getSpecifiedName()); assertEquals("addresses_KEY", manyToManyMapping.getMapKeyColumn().getName()); @@ -876,7 +876,7 @@ public class EclipseLink2_0JavaManyToManyMappingTests PersistentType persistentType = getPersistenceUnit().getPersistentType("test.Address"); ManyToManyMapping owningManyToManyMapping = (ManyToManyMapping) persistentType.getAttributeNamed("employees").getMapping(); - ((JoinTableRelationshipStrategy) owningManyToManyMapping.getRelationship().getPredominantJoiningStrategy()).getJoinTable().setSpecifiedName("MY_JOIN_TABLE"); + ((JoinTableRelationshipStrategy) owningManyToManyMapping.getRelationship().getStrategy()).getJoinTable().setSpecifiedName("MY_JOIN_TABLE"); assertEquals("MY_JOIN_TABLE", manyToManyMapping.getMapKeyColumn().getTable()); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); @@ -903,7 +903,7 @@ public class EclipseLink2_0JavaManyToManyMappingTests assertEquals("addresses_KEY", manyToManyMapping.getMapKeyColumn().getName()); assertEquals(TYPE_NAME + "_Address", manyToManyMapping.getMapKeyColumn().getTable());//join table name - manyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE"); + manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE"); assertEquals("MY_JOIN_TABLE", manyToManyMapping.getMapKeyColumn().getTable()); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaManyToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaManyToOneMappingTests.java index f4adef5201..24e7475894 100644 --- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaManyToOneMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaManyToOneMappingTests.java @@ -262,26 +262,26 @@ public class EclipseLink2_0JavaManyToOneMappingTests assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); - rel.setJoinColumnJoiningStrategy(); + rel.setStrategyToJoinColumn(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); - rel.setJoinTableJoiningStrategy(); + rel.setStrategyToJoinTable(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); - rel.setJoinColumnJoiningStrategy(); + rel.setStrategyToJoinColumn(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); } public void testUpdatePredominantJoiningStrategy() throws Exception { @@ -295,35 +295,35 @@ public class EclipseLink2_0JavaManyToOneMappingTests assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); resourceAttribute.addAnnotation(JPA.JOIN_COLUMN); getJpaProject().synchronizeContextModel(); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); resourceAttribute.addAnnotation(JPA.JOIN_TABLE); getJpaProject().synchronizeContextModel(); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); resourceAttribute.removeAnnotation(JPA.JOIN_COLUMN); getJpaProject().synchronizeContextModel(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); resourceAttribute.removeAnnotation(JPA.JOIN_TABLE); getJpaProject().synchronizeContextModel(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); } } diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaOneToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaOneToManyMappingTests.java index dadc76225f..d1ebc93844 100644 --- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaOneToManyMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaOneToManyMappingTests.java @@ -793,8 +793,8 @@ public class EclipseLink2_0JavaOneToManyMappingTests PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping(); - oneToManyMapping.getRelationship().setMappedByJoiningStrategy(); - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute("employee"); + oneToManyMapping.getRelationship().setStrategyToMappedBy(); + oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("employee"); assertNull(oneToManyMapping.getMapKeyColumn().getSpecifiedName()); assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getName()); @@ -828,7 +828,7 @@ public class EclipseLink2_0JavaOneToManyMappingTests assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getName()); assertEquals(TYPE_NAME + "_Address", oneToManyMapping.getMapKeyColumn().getTable());//join table name - oneToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("MY_PRIMARY_TABLE"); + oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_PRIMARY_TABLE"); assertEquals("MY_PRIMARY_TABLE", oneToManyMapping.getMapKeyColumn().getTable()); JavaResourcePersistentType typeResource = getJpaProject().getJavaResourcePersistentType(FULLY_QUALIFIED_TYPE_NAME); @@ -850,9 +850,9 @@ public class EclipseLink2_0JavaOneToManyMappingTests PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping(); - ((JoinColumnRelationship) oneToManyMapping.getRelationship()).setJoinColumnJoiningStrategy(); + ((JoinColumnRelationship) oneToManyMapping.getRelationship()).setStrategyToJoinColumn(); - JoinColumn joinColumn = ((JoinColumnRelationship) oneToManyMapping.getRelationship()).getJoinColumnJoiningStrategy().specifiedJoinColumns().next(); + JoinColumn joinColumn = ((JoinColumnRelationship) oneToManyMapping.getRelationship()).getJoinColumnStrategy().specifiedJoinColumns().next(); assertEquals("addresses_id", joinColumn.getDefaultName()); assertEquals("Address", joinColumn.getDefaultTable());//target table name @@ -876,7 +876,7 @@ public class EclipseLink2_0JavaOneToManyMappingTests PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping(); - ((JoinColumnRelationship) oneToManyMapping.getRelationship()).setJoinColumnJoiningStrategy(); + ((JoinColumnRelationship) oneToManyMapping.getRelationship()).setStrategyToJoinColumn(); assertNull(oneToManyMapping.getMapKeyColumn().getSpecifiedName()); assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getName()); @@ -907,7 +907,7 @@ public class EclipseLink2_0JavaOneToManyMappingTests PersistentAttribute persistentAttribute = getJavaPersistentType().attributes().next(); OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping(); - ((JoinColumnRelationship) oneToManyMapping.getRelationship()).setJoinColumnJoiningStrategy(); + ((JoinColumnRelationship) oneToManyMapping.getRelationship()).setStrategyToJoinColumn(); ((Orderable2_0) oneToManyMapping.getOrderable()).setOrderColumnOrdering(true); OrderColumn2_0 orderColumn = ((Orderable2_0) oneToManyMapping.getOrderable()).getOrderColumn(); @@ -934,33 +934,33 @@ public class EclipseLink2_0JavaOneToManyMappingTests assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); - rel.setJoinColumnJoiningStrategy(); + rel.setStrategyToJoinColumn(); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); - rel.setMappedByJoiningStrategy(); + rel.setStrategyToMappedBy(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNotNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); - rel.setJoinTableJoiningStrategy(); + rel.setStrategyToJoinTable(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); } public void testUpdatePredominantJoiningStrategy() throws Exception { @@ -976,63 +976,63 @@ public class EclipseLink2_0JavaOneToManyMappingTests assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); annotation.setMappedBy("foo"); getJpaProject().synchronizeContextModel(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNotNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); resourceAttribute.addAnnotation(JPA.JOIN_TABLE); getJpaProject().synchronizeContextModel(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNotNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); resourceAttribute.addAnnotation(JPA.JOIN_COLUMN); getJpaProject().synchronizeContextModel(); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNotNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); annotation.setMappedBy(null); getJpaProject().synchronizeContextModel(); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); resourceAttribute.removeAnnotation(JPA.JOIN_TABLE); getJpaProject().synchronizeContextModel(); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); resourceAttribute.removeAnnotation(JPA.JOIN_COLUMN); getJpaProject().synchronizeContextModel(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); assertNull(annotation.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); } public void testMapKeySpecifiedAttributeOverrides() throws Exception { diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaOneToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaOneToOneMappingTests.java index 6806a26f87..1e3de46dd6 100644 --- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaOneToOneMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/java/EclipseLink2_0JavaOneToOneMappingTests.java @@ -436,7 +436,7 @@ public class EclipseLink2_0JavaOneToOneMappingTests OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); Iterator attributeNames = - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToOneMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -447,12 +447,12 @@ public class EclipseLink2_0JavaOneToOneMappingTests oneToOneMapping.setSpecifiedTargetEntity("foo"); attributeNames = - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToOneMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertFalse(attributeNames.hasNext()); oneToOneMapping.setSpecifiedTargetEntity(null); attributeNames = - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToOneMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -477,7 +477,7 @@ public class EclipseLink2_0JavaOneToOneMappingTests OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); Iterator attributeNames = - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToOneMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -488,12 +488,12 @@ public class EclipseLink2_0JavaOneToOneMappingTests oneToOneMapping.setSpecifiedTargetEntity("foo"); attributeNames = - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToOneMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertFalse(attributeNames.hasNext()); oneToOneMapping.setSpecifiedTargetEntity(null); attributeNames = - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToOneMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -661,50 +661,50 @@ public class EclipseLink2_0JavaOneToOneMappingTests assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNull(annotation.getMappedBy()); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); - rel.setPrimaryKeyJoinColumnJoiningStrategy(); + rel.setStrategyToPrimaryKeyJoinColumn(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNotNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNull(annotation.getMappedBy()); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); - rel.setMappedByJoiningStrategy(); + rel.setStrategyToMappedBy(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNotNull(annotation.getMappedBy()); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertTrue(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); - rel.setJoinTableJoiningStrategy(); + rel.setStrategyToJoinTable(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNull(annotation.getMappedBy()); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertTrue(rel.strategyIsJoinTable()); - rel.setJoinColumnJoiningStrategy(); + rel.setStrategyToJoinColumn(); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_COLUMN)); assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNull(annotation.getMappedBy()); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); } public void testUpdatePredominantJoiningStrategy() throws Exception { @@ -721,10 +721,10 @@ public class EclipseLink2_0JavaOneToOneMappingTests assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNull(annotation.getMappedBy()); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); resourceAttribute.addAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN); getJpaProject().synchronizeContextModel(); @@ -732,10 +732,10 @@ public class EclipseLink2_0JavaOneToOneMappingTests assertNotNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNull(annotation.getMappedBy()); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); annotation.setMappedBy("foo"); getJpaProject().synchronizeContextModel(); @@ -743,10 +743,10 @@ public class EclipseLink2_0JavaOneToOneMappingTests assertNotNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNotNull(annotation.getMappedBy()); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertTrue(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); resourceAttribute.addAnnotation(JPA.JOIN_COLUMN); getJpaProject().synchronizeContextModel(); @@ -754,10 +754,10 @@ public class EclipseLink2_0JavaOneToOneMappingTests assertNotNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNotNull(annotation.getMappedBy()); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertTrue(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); resourceAttribute.addAnnotation(JPA.JOIN_TABLE); getJpaProject().synchronizeContextModel(); @@ -765,10 +765,10 @@ public class EclipseLink2_0JavaOneToOneMappingTests assertNotNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNotNull(annotation.getMappedBy()); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertTrue(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); resourceAttribute.removeAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN); getJpaProject().synchronizeContextModel(); @@ -776,10 +776,10 @@ public class EclipseLink2_0JavaOneToOneMappingTests assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNotNull(annotation.getMappedBy()); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertTrue(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); annotation.setMappedBy(null); getJpaProject().synchronizeContextModel(); @@ -787,10 +787,10 @@ public class EclipseLink2_0JavaOneToOneMappingTests assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNull(annotation.getMappedBy()); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertTrue(rel.strategyIsJoinTable()); resourceAttribute.removeAnnotation(JPA.JOIN_COLUMN); getJpaProject().synchronizeContextModel(); @@ -798,10 +798,10 @@ public class EclipseLink2_0JavaOneToOneMappingTests assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNull(annotation.getMappedBy()); assertNotNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertTrue(rel.strategyIsJoinTable()); resourceAttribute.removeAnnotation(JPA.JOIN_TABLE); getJpaProject().synchronizeContextModel(); @@ -809,9 +809,9 @@ public class EclipseLink2_0JavaOneToOneMappingTests assertNull(resourceAttribute.getAnnotation(JPA.PRIMARY_KEY_JOIN_COLUMN)); assertNull(annotation.getMappedBy()); assertNull(resourceAttribute.getAnnotation(JPA.JOIN_TABLE)); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); } } diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmManyToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmManyToManyMappingTests.java index 5bfe1dcb7c..3d7251fbe6 100644 --- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmManyToManyMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmManyToManyMappingTests.java @@ -255,7 +255,7 @@ public class EclipseLink2_0OrmManyToManyMappingTests ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); Iterator attributeNames = - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + manyToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -266,12 +266,12 @@ public class EclipseLink2_0OrmManyToManyMappingTests manyToManyMapping.setSpecifiedTargetEntity("foo"); attributeNames = - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + manyToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertFalse(attributeNames.hasNext()); manyToManyMapping.setSpecifiedTargetEntity(null); attributeNames = - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + manyToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -301,7 +301,7 @@ public class EclipseLink2_0OrmManyToManyMappingTests ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping(); Iterator attributeNames = - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + manyToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -312,12 +312,12 @@ public class EclipseLink2_0OrmManyToManyMappingTests manyToManyMapping.setSpecifiedTargetEntity("foo"); attributeNames = - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + manyToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertFalse(attributeNames.hasNext()); manyToManyMapping.setSpecifiedTargetEntity(null); attributeNames = - manyToManyMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + manyToManyMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -561,8 +561,8 @@ public class EclipseLink2_0OrmManyToManyMappingTests OrmPersistentType printQueuePersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".PrintQueue"); OrmPersistentAttribute jobsPersistentAttribute = printQueuePersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "jobs"); OrmManyToManyMapping jobsMapping = (OrmManyToManyMapping) jobsPersistentAttribute.getMapping(); - jobsMapping.getRelationship().setMappedByJoiningStrategy(); - jobsMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute("queues"); + jobsMapping.getRelationship().setStrategyToMappedBy(); + jobsMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("queues"); OrmPersistentType printJobPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".PrintJob"); OrmPersistentAttribute queuesPersistentAttribute = printJobPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, "queues"); @@ -610,7 +610,7 @@ public class EclipseLink2_0OrmManyToManyMappingTests assertEquals("MY_TABLE_OTHER_TABLE", jobsOrderColumn.getTable()); assertEquals("MY_TABLE_OTHER_TABLE", queuesOrderColumn.getTable()); - queuesMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE"); + queuesMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE"); assertEquals("MY_JOIN_TABLE", jobsOrderColumn.getTable()); assertEquals("MY_JOIN_TABLE", queuesOrderColumn.getTable()); } @@ -666,7 +666,7 @@ public class EclipseLink2_0OrmManyToManyMappingTests assertEquals("queues_ORDER", queuesOrderable.getOrderColumn().getName()); JavaManyToManyMapping javaQueuesManyToManyMapping = (JavaManyToManyMapping) queuesPersistentAttribute2.getJavaPersistentAttribute().getMapping(); - javaQueuesManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("JOIN_TABLE"); + javaQueuesManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("JOIN_TABLE"); assertEquals("JOIN_TABLE", jobsOrderable.getOrderColumn().getTable()); assertEquals("FOO", jobsOrderable.getOrderColumn().getName()); assertEquals("JOIN_TABLE", queuesOrderable.getOrderColumn().getTable()); @@ -882,7 +882,7 @@ public class EclipseLink2_0OrmManyToManyMappingTests //set Column table element in Java JavaManyToManyMapping2_0 javaManyToManyMapping = (JavaManyToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping(); - javaManyToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE"); + javaManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE"); assertEquals("JAVA_JOIN_TABLE", ormColumn.getTable()); javaManyToManyMapping.getMapKeyColumn().setSpecifiedTable("JAVA_TABLE"); assertEquals("JAVA_TABLE", ormColumn.getTable()); @@ -909,7 +909,7 @@ public class EclipseLink2_0OrmManyToManyMappingTests assertEquals(FetchType.EAGER, virtualManyToManyMapping.getSpecifiedFetch()); assertEquals("Address", virtualManyToManyMapping.getSpecifiedTargetEntity()); assertNull(virtualManyToManyMapping.getRelationship(). - getMappedByJoiningStrategy().getMappedByAttribute()); + getMappedByStrategy().getMappedByAttribute()); Cascade2_0 cascade = (Cascade2_0) virtualManyToManyMapping.getCascade(); assertTrue(cascade.isAll()); @@ -945,7 +945,7 @@ public class EclipseLink2_0OrmManyToManyMappingTests assertEquals("address", ormManyToManyMapping.getName()); assertEquals(FetchType.LAZY, ormManyToManyMapping.getFetch()); assertEquals("test.Address", ormManyToManyMapping.getTargetEntity()); - assertNull(ormManyToManyMapping.getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + assertNull(ormManyToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute()); Cascade2_0 cascade = (Cascade2_0) ormManyToManyMapping.getCascade(); assertFalse(cascade.isAll()); diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmOneToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmOneToManyMappingTests.java index 8605224183..fd7a893c63 100644 --- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmOneToManyMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmOneToManyMappingTests.java @@ -479,8 +479,8 @@ public class EclipseLink2_0OrmOneToManyMappingTests getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".PrintJob"); OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, "jobs"); OrmOneToManyMapping oneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping(); - oneToManyMapping.getRelationship().setMappedByJoiningStrategy(); - oneToManyMapping.getRelationship().getMappedByJoiningStrategy().setMappedByAttribute("queue"); + oneToManyMapping.getRelationship().setStrategyToMappedBy(); + oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("queue"); Orderable2_0 orderable = ((Orderable2_0) oneToManyMapping.getOrderable()); assertEquals(false, orderable.isOrderColumnOrdering()); @@ -742,7 +742,7 @@ public class EclipseLink2_0OrmOneToManyMappingTests //set Column table element in Java JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping(); - javaOneToManyMapping.getRelationship().getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE"); + javaOneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE"); assertEquals("JAVA_JOIN_TABLE", ormColumn.getTable()); javaOneToManyMapping.getMapKeyColumn().setSpecifiedTable("JAVA_TABLE"); assertEquals("JAVA_TABLE", ormColumn.getTable()); @@ -767,33 +767,33 @@ public class EclipseLink2_0OrmOneToManyMappingTests assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); - rel.setJoinColumnJoiningStrategy(); + rel.setStrategyToJoinColumn(); assertFalse(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); - rel.setMappedByJoiningStrategy(); + rel.setStrategyToMappedBy(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); assertNotNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); - rel.setJoinTableJoiningStrategy(); + rel.setStrategyToJoinTable(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); } public void testUpdatePredominantJoiningStrategy() throws Exception { @@ -808,63 +808,63 @@ public class EclipseLink2_0OrmOneToManyMappingTests assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); resourceMapping.setMappedBy("foo"); getJpaProject().synchronizeContextModel(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); assertNotNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); resourceMapping.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable()); getJpaProject().synchronizeContextModel(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNotNull(resourceMapping.getJoinTable()); assertNotNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); resourceMapping.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn()); getJpaProject().synchronizeContextModel(); assertFalse(resourceMapping.getJoinColumns().isEmpty()); assertNotNull(resourceMapping.getJoinTable()); assertNotNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertTrue(rel.strategyIsMappedBy()); resourceMapping.setMappedBy(null); getJpaProject().synchronizeContextModel(); assertFalse(resourceMapping.getJoinColumns().isEmpty()); assertNotNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); resourceMapping.setJoinTable(null); getJpaProject().synchronizeContextModel(); assertFalse(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); resourceMapping.getJoinColumns().clear(); getJpaProject().synchronizeContextModel(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); assertNull(resourceMapping.getMappedBy()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); + assertFalse(rel.strategyIsMappedBy()); } public void testTargetForeignKeyJoinColumnStrategy() throws Exception { @@ -877,9 +877,9 @@ public class EclipseLink2_0OrmOneToManyMappingTests OrmReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributeNamed("addresses"); OneToManyMapping2_0 virtualOneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping(); JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getJavaPersistentAttribute().getMapping(); - ((OneToManyRelationship2_0) javaOneToManyMapping.getRelationship()).setJoinColumnJoiningStrategy(); + ((OneToManyRelationship2_0) javaOneToManyMapping.getRelationship()).setStrategyToJoinColumn(); - JoinColumn joinColumn = ((OneToManyRelationship2_0) virtualOneToManyMapping.getRelationship()).getJoinColumnJoiningStrategy().specifiedJoinColumns().next(); + JoinColumn joinColumn = ((OneToManyRelationship2_0) virtualOneToManyMapping.getRelationship()).getJoinColumnStrategy().specifiedJoinColumns().next(); assertTrue(persistentAttribute.isVirtual()); assertEquals("addresses_id", joinColumn.getDefaultName()); assertEquals("Address", joinColumn.getDefaultTable());//target table name @@ -893,10 +893,10 @@ public class EclipseLink2_0OrmOneToManyMappingTests persistentAttribute = ormPersistentType.getAttributeNamed("addresses"); OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) persistentAttribute.getMapping(); assertFalse(persistentAttribute.isVirtual()); - assertFalse(((OneToManyRelationship2_0) ormOneToManyMapping.getRelationship()).usesJoinColumnJoiningStrategy()); + assertFalse(((OneToManyRelationship2_0) ormOneToManyMapping.getRelationship()).strategyIsJoinColumn()); - ((OneToManyRelationship2_0) ormOneToManyMapping.getRelationship()).setJoinColumnJoiningStrategy(); - joinColumn = ((OneToManyRelationship2_0) ormOneToManyMapping.getRelationship()).getJoinColumnJoiningStrategy().specifiedJoinColumns().next(); + ((OneToManyRelationship2_0) ormOneToManyMapping.getRelationship()).setStrategyToJoinColumn(); + joinColumn = ((OneToManyRelationship2_0) ormOneToManyMapping.getRelationship()).getJoinColumnStrategy().specifiedJoinColumns().next(); assertFalse(persistentAttribute.isVirtual()); assertEquals("addresses_id", joinColumn.getDefaultName()); assertEquals("ADDRESS_PRIMARY_TABLE", joinColumn.getDefaultTable());//target table name @@ -922,7 +922,7 @@ public class EclipseLink2_0OrmOneToManyMappingTests OrmReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributeNamed("addresses"); OneToManyMapping2_0 virtualOneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping(); JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getJavaPersistentAttribute().getMapping(); - ((OneToManyRelationship2_0) javaOneToManyMapping.getRelationship()).setJoinColumnJoiningStrategy(); + ((OneToManyRelationship2_0) javaOneToManyMapping.getRelationship()).setStrategyToJoinColumn(); assertTrue(persistentAttribute.isVirtual()); assertEquals("addresses_KEY", virtualOneToManyMapping.getMapKeyColumn().getName()); @@ -948,9 +948,9 @@ public class EclipseLink2_0OrmOneToManyMappingTests persistentAttribute = ormPersistentType.getAttributeNamed("addresses"); OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) persistentAttribute.getMapping(); assertFalse(persistentAttribute.isVirtual()); - assertFalse(((OneToManyRelationship2_0) ormOneToManyMapping.getRelationship()).usesJoinColumnJoiningStrategy()); + assertFalse(((OneToManyRelationship2_0) ormOneToManyMapping.getRelationship()).strategyIsJoinColumn()); - ((OneToManyRelationship2_0) ormOneToManyMapping.getRelationship()).setJoinColumnJoiningStrategy(); + ((OneToManyRelationship2_0) ormOneToManyMapping.getRelationship()).setStrategyToJoinColumn(); assertEquals("addresses_KEY", ormOneToManyMapping.getMapKeyColumn().getName()); assertEquals("ADDRESS_PRIMARY_TABLE", ormOneToManyMapping.getMapKeyColumn().getTable());//target table name @@ -976,7 +976,7 @@ public class EclipseLink2_0OrmOneToManyMappingTests OrmReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributeNamed("addresses"); OneToManyMapping2_0 virtualOneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping(); JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getJavaPersistentAttribute().getMapping(); - ((OneToManyRelationship2_0) javaOneToManyMapping.getRelationship()).setJoinColumnJoiningStrategy(); + ((OneToManyRelationship2_0) javaOneToManyMapping.getRelationship()).setStrategyToJoinColumn(); ((Orderable2_0) javaOneToManyMapping.getOrderable()).setOrderColumnOrdering(true); OrderColumn2_0 orderColumn = ((Orderable2_0) virtualOneToManyMapping.getOrderable()).getOrderColumn(); @@ -992,9 +992,9 @@ public class EclipseLink2_0OrmOneToManyMappingTests persistentAttribute = ormPersistentType.getAttributeNamed("addresses"); OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) persistentAttribute.getMapping(); assertFalse(persistentAttribute.isVirtual()); - assertFalse(((OneToManyRelationship2_0) ormOneToManyMapping.getRelationship()).usesJoinColumnJoiningStrategy()); + assertFalse(((OneToManyRelationship2_0) ormOneToManyMapping.getRelationship()).strategyIsJoinColumn()); - ((OneToManyRelationship2_0) ormOneToManyMapping.getRelationship()).setJoinColumnJoiningStrategy(); + ((OneToManyRelationship2_0) ormOneToManyMapping.getRelationship()).setStrategyToJoinColumn(); assertFalse(((Orderable2_0) ormOneToManyMapping.getOrderable()).isOrderColumnOrdering()); ((Orderable2_0) ormOneToManyMapping.getOrderable()).setOrderColumnOrdering(true); orderColumn = ((Orderable2_0) ormOneToManyMapping.getOrderable()).getOrderColumn(); @@ -1024,7 +1024,7 @@ public class EclipseLink2_0OrmOneToManyMappingTests assertEquals(FetchType.EAGER, virtualOneToManyMapping.getSpecifiedFetch()); assertEquals("Address", virtualOneToManyMapping.getSpecifiedTargetEntity()); assertNull(virtualOneToManyMapping.getRelationship(). - getMappedByJoiningStrategy().getMappedByAttribute()); + getMappedByStrategy().getMappedByAttribute()); Cascade2_0 cascade = (Cascade2_0) virtualOneToManyMapping.getCascade(); assertTrue(cascade.isAll()); @@ -1057,7 +1057,7 @@ public class EclipseLink2_0OrmOneToManyMappingTests assertEquals("address", virtualOneToManyMapping.getName()); assertEquals(FetchType.LAZY, virtualOneToManyMapping.getFetch()); assertEquals("test.Address", virtualOneToManyMapping.getTargetEntity()); - assertNull(virtualOneToManyMapping.getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + assertNull(virtualOneToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute()); Cascade2_0 cascade = (Cascade2_0) virtualOneToManyMapping.getCascade(); assertFalse(cascade.isAll()); diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmOneToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmOneToOneMappingTests.java index 6c34323ad6..bf7d0ec413 100644 --- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmOneToOneMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/EclipseLink2_0OrmOneToOneMappingTests.java @@ -420,7 +420,7 @@ public class EclipseLink2_0OrmOneToOneMappingTests OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); Iterator attributeNames = - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToOneMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -431,12 +431,12 @@ public class EclipseLink2_0OrmOneToOneMappingTests oneToOneMapping.setSpecifiedTargetEntity("foo"); attributeNames = - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToOneMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertFalse(attributeNames.hasNext()); oneToOneMapping.setSpecifiedTargetEntity(null); attributeNames = - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToOneMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -466,7 +466,7 @@ public class EclipseLink2_0OrmOneToOneMappingTests OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping(); Iterator attributeNames = - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToOneMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -477,12 +477,12 @@ public class EclipseLink2_0OrmOneToOneMappingTests oneToOneMapping.setSpecifiedTargetEntity("foo"); attributeNames = - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToOneMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertFalse(attributeNames.hasNext()); oneToOneMapping.setSpecifiedTargetEntity(null); attributeNames = - oneToOneMapping.getRelationship().getMappedByJoiningStrategy().candidateMappedByAttributeNames(); + oneToOneMapping.getRelationship().getMappedByStrategy().candidateMappedByAttributeNames(); assertEquals("id", attributeNames.next()); assertEquals("city", attributeNames.next()); assertEquals("state", attributeNames.next()); @@ -547,8 +547,8 @@ public class EclipseLink2_0OrmOneToOneMappingTests OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address"); JavaOneToOneMapping2_0 javaOneToOneMapping = ((JavaOneToOneMapping2_0) ormPersistentAttribute.getJavaPersistentAttribute().getMapping()); OneToOneMapping2_0 virtualOneToOneMapping = (OneToOneMapping2_0) ormPersistentAttribute.getMapping(); - ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).setJoinTableJoiningStrategy(); - JoinTable virtualJoinTable = ((OneToOneRelationship2_0) virtualOneToOneMapping.getRelationship()).getJoinTableJoiningStrategy().getJoinTable(); + ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).setStrategyToJoinTable(); + JoinTable virtualJoinTable = ((OneToOneRelationship2_0) virtualOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable(); assertTrue(ormPersistentAttribute.isVirtual()); assertEquals(null, virtualJoinTable.getSpecifiedName()); @@ -570,7 +570,7 @@ public class EclipseLink2_0OrmOneToOneMappingTests assertEquals("address_id", virtualInverseOrmJoinColumn.getDefaultName()); assertEquals("id", virtualInverseOrmJoinColumn.getDefaultReferencedColumnName()); - JavaJoinTable javaJoinTable = ((JavaOneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).getJoinTableJoiningStrategy().getJoinTable(); + JavaJoinTable javaJoinTable = ((JavaOneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable(); javaJoinTable.setSpecifiedName("FOO"); javaJoinTable.setSpecifiedCatalog("CATALOG"); javaJoinTable.setSpecifiedSchema("SCHEMA"); @@ -601,8 +601,8 @@ public class EclipseLink2_0OrmOneToOneMappingTests OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, "address"); OrmOneToOneMapping2_0 ormOneToOneMapping = (OrmOneToOneMapping2_0) ormPersistentAttribute.getMapping(); - ((OneToOneRelationship2_0) ormOneToOneMapping.getRelationship()).setJoinTableJoiningStrategy(); - OrmJoinTable ormJoinTable = ((OrmOneToOneRelationship2_0) ormOneToOneMapping.getRelationship()).getJoinTableJoiningStrategy().getJoinTable(); + ((OneToOneRelationship2_0) ormOneToOneMapping.getRelationship()).setStrategyToJoinTable(); + OrmJoinTable ormJoinTable = ((OrmOneToOneRelationship2_0) ormOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable(); assertEquals(null, ormJoinTable.getDefaultName()); createTestTargetEntityAddress(); @@ -617,8 +617,8 @@ public class EclipseLink2_0OrmOneToOneMappingTests assertEquals("BAR_FOO", ormJoinTable.getDefaultName()); JavaOneToOneMapping2_0 javaOneToOneMapping = (JavaOneToOneMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("address").getMapping(); - ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).setJoinTableJoiningStrategy(); - ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE"); + ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).setStrategyToJoinTable(); + ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE"); assertEquals("BAR_FOO", ormJoinTable.getDefaultName()); @@ -635,15 +635,15 @@ public class EclipseLink2_0OrmOneToOneMappingTests //ormPersistentType.getMapping().setSpecifiedMetadataComplete(null); OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("address"); OneToOneMapping2_0 virtualOneToOneMapping = (OneToOneMapping2_0) ormPersistentAttribute2.getMapping(); - JoinTable virtualJoinTable = ((OneToOneRelationship2_0) virtualOneToOneMapping.getRelationship()).getJoinTableJoiningStrategy().getJoinTable(); + JoinTable virtualJoinTable = ((OneToOneRelationship2_0) virtualOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable(); assertTrue(ormPersistentAttribute2.isVirtual()); assertEquals("JAVA_JOIN_TABLE", virtualJoinTable.getSpecifiedName());//specifiedName since this is a virtual mapping now - ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).getJoinTableJoiningStrategy().removeStrategy(); - virtualJoinTable = ((OneToOneRelationship2_0) virtualOneToOneMapping.getRelationship()).getJoinTableJoiningStrategy().getJoinTable(); + ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).getJoinTableStrategy().removeStrategy(); + virtualJoinTable = ((OneToOneRelationship2_0) virtualOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable(); assertNull(virtualJoinTable); - ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).setJoinTableJoiningStrategy(); - virtualJoinTable = ((OneToOneRelationship2_0) virtualOneToOneMapping.getRelationship()).getJoinTableJoiningStrategy().getJoinTable(); + ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).setStrategyToJoinTable(); + virtualJoinTable = ((OneToOneRelationship2_0) virtualOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable(); assertEquals("BAR_FOO", virtualJoinTable.getName()); assertEquals("BAR_FOO", virtualJoinTable.getDefaultName()); @@ -667,50 +667,50 @@ public class EclipseLink2_0OrmOneToOneMappingTests assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNull(resourceMapping.getMappedBy()); assertNull(resourceMapping.getJoinTable()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); - rel.setMappedByJoiningStrategy(); + rel.setStrategyToMappedBy(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNotNull(resourceMapping.getMappedBy()); assertNull(resourceMapping.getJoinTable()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertTrue(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); - rel.setPrimaryKeyJoinColumnJoiningStrategy(); + rel.setStrategyToPrimaryKeyJoinColumn(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNull(resourceMapping.getMappedBy()); assertNull(resourceMapping.getJoinTable()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); - rel.setJoinTableJoiningStrategy(); + rel.setStrategyToJoinTable(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNull(resourceMapping.getMappedBy()); assertNotNull(resourceMapping.getJoinTable()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertTrue(rel.strategyIsJoinTable()); - rel.setJoinColumnJoiningStrategy(); + rel.setStrategyToJoinColumn(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNull(resourceMapping.getMappedBy()); assertNull(resourceMapping.getJoinTable()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); } public void testUpdatePredominantJoiningStrategy() throws Exception { @@ -726,10 +726,10 @@ public class EclipseLink2_0OrmOneToOneMappingTests assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNull(resourceMapping.getMappedBy()); assertNull(resourceMapping.getJoinTable()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); resourceMapping.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumn()); getJpaProject().synchronizeContextModel(); @@ -737,10 +737,10 @@ public class EclipseLink2_0OrmOneToOneMappingTests assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNull(resourceMapping.getMappedBy()); assertNull(resourceMapping.getJoinTable()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); resourceMapping.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn()); getJpaProject().synchronizeContextModel(); @@ -748,10 +748,10 @@ public class EclipseLink2_0OrmOneToOneMappingTests assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNull(resourceMapping.getMappedBy()); assertNull(resourceMapping.getJoinTable()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); resourceMapping.setMappedBy("foo"); getJpaProject().synchronizeContextModel(); @@ -759,10 +759,10 @@ public class EclipseLink2_0OrmOneToOneMappingTests assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNotNull(resourceMapping.getMappedBy()); assertNull(resourceMapping.getJoinTable()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertTrue(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); resourceMapping.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable()); getJpaProject().synchronizeContextModel(); @@ -770,10 +770,10 @@ public class EclipseLink2_0OrmOneToOneMappingTests assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNotNull(resourceMapping.getMappedBy()); assertNotNull(resourceMapping.getJoinTable()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertTrue(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); resourceMapping.getPrimaryKeyJoinColumns().clear(); getJpaProject().synchronizeContextModel(); @@ -781,10 +781,10 @@ public class EclipseLink2_0OrmOneToOneMappingTests assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNotNull(resourceMapping.getMappedBy()); assertNotNull(resourceMapping.getJoinTable()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertTrue(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); resourceMapping.getJoinColumns().clear(); getJpaProject().synchronizeContextModel(); @@ -792,10 +792,10 @@ public class EclipseLink2_0OrmOneToOneMappingTests assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNotNull(resourceMapping.getMappedBy()); assertNotNull(resourceMapping.getJoinTable()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertTrue(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertTrue(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); resourceMapping.setMappedBy(null); getJpaProject().synchronizeContextModel(); @@ -803,10 +803,10 @@ public class EclipseLink2_0OrmOneToOneMappingTests assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNull(resourceMapping.getMappedBy()); assertNotNull(resourceMapping.getJoinTable()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertTrue(rel.strategyIsJoinTable()); resourceMapping.setJoinTable(null); getJpaProject().synchronizeContextModel(); @@ -814,10 +814,10 @@ public class EclipseLink2_0OrmOneToOneMappingTests assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty()); assertNull(resourceMapping.getMappedBy()); assertNull(resourceMapping.getJoinTable()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesPrimaryKeyJoinColumnJoiningStrategy()); - assertFalse(rel.usesMappedByJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsPrimaryKeyJoinColumn()); + assertFalse(rel.strategyIsMappedBy()); + assertFalse(rel.strategyIsJoinTable()); } public void testVirtualMappingMetadataCompleteFalse() throws Exception { @@ -835,10 +835,10 @@ public class EclipseLink2_0OrmOneToOneMappingTests assertEquals(Boolean.FALSE, virtualOneToOneMapping.getSpecifiedOptional()); assertEquals("Address", virtualOneToOneMapping.getSpecifiedTargetEntity()); assertNull(virtualOneToOneMapping.getRelationship(). - getMappedByJoiningStrategy().getMappedByAttribute()); + getMappedByStrategy().getMappedByAttribute()); JoinColumn ormJoinColumn = - virtualOneToOneMapping.getRelationship().getJoinColumnJoiningStrategy().specifiedJoinColumns().next(); + virtualOneToOneMapping.getRelationship().getJoinColumnStrategy().specifiedJoinColumns().next(); assertEquals("MY_COLUMN", ormJoinColumn.getSpecifiedName()); assertEquals("MY_REFERENCED_COLUMN", ormJoinColumn.getSpecifiedReferencedColumnName()); assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUnique()); @@ -880,7 +880,7 @@ public class EclipseLink2_0OrmOneToOneMappingTests assertEquals(FetchType.EAGER, ormOneToOneMapping.getFetch()); assertEquals(true, ormOneToOneMapping.isOptional()); assertEquals("test.Address", ormOneToOneMapping.getTargetEntity()); - assertNull(ormOneToOneMapping.getRelationship().getMappedByJoiningStrategy().getMappedByAttribute()); + assertNull(ormOneToOneMapping.getRelationship().getMappedByStrategy().getMappedByAttribute()); //TODO default join columns in xml one-to-one // XmlJoinColumn ormJoinColumn = ormOneToOneMapping.specifiedJoinColumns().next(); diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/Eclipselink2_0OrmManyToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/Eclipselink2_0OrmManyToOneMappingTests.java index d517ecdceb..0b5869a620 100644 --- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/Eclipselink2_0OrmManyToOneMappingTests.java +++ b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/src/org/eclipse/jpt/eclipselink2_0/core/tests/internal/context/orm/Eclipselink2_0OrmManyToOneMappingTests.java @@ -342,8 +342,8 @@ public class Eclipselink2_0OrmManyToOneMappingTests OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address"); JavaManyToOneMapping2_0 javaManyToOneMapping = ((JavaManyToOneMapping2_0) ormPersistentAttribute.getJavaPersistentAttribute().getMapping()); ManyToOneMapping2_0 virtualManyToOneMapping = (ManyToOneMapping2_0) ormPersistentAttribute.getMapping(); - ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).setJoinTableJoiningStrategy(); - JoinTable ormJoinTable = ((ManyToOneRelationship2_0) virtualManyToOneMapping.getRelationship()).getJoinTableJoiningStrategy().getJoinTable(); + ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).setStrategyToJoinTable(); + JoinTable ormJoinTable = ((ManyToOneRelationship2_0) virtualManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable(); assertTrue(ormPersistentAttribute.isVirtual()); assertEquals(null, ormJoinTable.getSpecifiedName()); @@ -365,7 +365,7 @@ public class Eclipselink2_0OrmManyToOneMappingTests assertEquals("address_id", inverseOrmJoinColumn.getDefaultName()); assertEquals("id", inverseOrmJoinColumn.getDefaultReferencedColumnName()); - JavaJoinTable javaJoinTable = ((JavaManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).getJoinTableJoiningStrategy().getJoinTable(); + JavaJoinTable javaJoinTable = ((JavaManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable(); javaJoinTable.setSpecifiedName("FOO"); javaJoinTable.setSpecifiedCatalog("CATALOG"); javaJoinTable.setSpecifiedSchema("SCHEMA"); @@ -396,8 +396,8 @@ public class Eclipselink2_0OrmManyToOneMappingTests OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedAttribute(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, "address"); OrmManyToOneMapping2_0 ormManyToOneMapping = (OrmManyToOneMapping2_0) ormPersistentAttribute.getMapping(); - ((ManyToOneRelationship2_0) ormManyToOneMapping.getRelationship()).setJoinTableJoiningStrategy(); - JoinTable ormJoinTable = ((OrmManyToOneRelationship2_0) ormManyToOneMapping.getRelationship()).getJoinTableJoiningStrategy().getJoinTable(); + ((ManyToOneRelationship2_0) ormManyToOneMapping.getRelationship()).setStrategyToJoinTable(); + JoinTable ormJoinTable = ((OrmManyToOneRelationship2_0) ormManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable(); assertEquals(null, ormJoinTable.getDefaultName()); createTestTargetEntityAddress(); @@ -412,8 +412,8 @@ public class Eclipselink2_0OrmManyToOneMappingTests assertEquals("BAR_FOO", ormJoinTable.getDefaultName()); JavaManyToOneMapping2_0 javaManyToOneMapping = (JavaManyToOneMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("address").getMapping(); - ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).setJoinTableJoiningStrategy(); - ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).getJoinTableJoiningStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE"); + ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).setStrategyToJoinTable(); + ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE"); assertEquals("BAR_FOO", ormJoinTable.getDefaultName()); @@ -430,15 +430,15 @@ public class Eclipselink2_0OrmManyToOneMappingTests //ormPersistentType.getMapping().setSpecifiedMetadataComplete(null); OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("address"); ManyToOneMapping2_0 virtualManyToOneMapping = (ManyToOneMapping2_0) ormPersistentAttribute2.getMapping(); - ormJoinTable = ((ManyToOneRelationship2_0) virtualManyToOneMapping.getRelationship()).getJoinTableJoiningStrategy().getJoinTable(); + ormJoinTable = ((ManyToOneRelationship2_0) virtualManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable(); assertTrue(ormPersistentAttribute2.isVirtual()); assertEquals("JAVA_JOIN_TABLE", ormJoinTable.getSpecifiedName());//specifiedName since this is a virtual mapping now - ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).getJoinTableJoiningStrategy().removeStrategy(); - ormJoinTable = ((ManyToOneRelationship2_0) virtualManyToOneMapping.getRelationship()).getJoinTableJoiningStrategy().getJoinTable(); + ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).getJoinTableStrategy().removeStrategy(); + ormJoinTable = ((ManyToOneRelationship2_0) virtualManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable(); assertNull(ormJoinTable); - ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).setJoinTableJoiningStrategy(); - ormJoinTable = ((ManyToOneRelationship2_0) virtualManyToOneMapping.getRelationship()).getJoinTableJoiningStrategy().getJoinTable(); + ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).setStrategyToJoinTable(); + ormJoinTable = ((ManyToOneRelationship2_0) virtualManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable(); assertEquals("BAR_FOO", ormJoinTable.getName()); assertEquals("BAR_FOO", ormJoinTable.getDefaultName()); @@ -460,26 +460,26 @@ public class Eclipselink2_0OrmManyToOneMappingTests assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); - rel.setJoinColumnJoiningStrategy(); + rel.setStrategyToJoinColumn(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); - rel.setJoinTableJoiningStrategy(); + rel.setStrategyToJoinTable(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNotNull(resourceMapping.getJoinTable()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); - rel.setJoinColumnJoiningStrategy(); + rel.setStrategyToJoinColumn(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); } public void testUpdatePredominantJoiningStrategy() throws Exception { @@ -493,29 +493,29 @@ public class Eclipselink2_0OrmManyToOneMappingTests assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); resourceMapping.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn()); getJpaProject().synchronizeContextModel(); assertFalse(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); resourceMapping.getJoinColumns().clear(); getJpaProject().synchronizeContextModel(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNull(resourceMapping.getJoinTable()); - assertTrue(rel.usesJoinColumnJoiningStrategy()); - assertFalse(rel.usesJoinTableJoiningStrategy()); + assertTrue(rel.strategyIsJoinColumn()); + assertFalse(rel.strategyIsJoinTable()); resourceMapping.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable()); getJpaProject().synchronizeContextModel(); assertTrue(resourceMapping.getJoinColumns().isEmpty()); assertNotNull(resourceMapping.getJoinTable()); - assertFalse(rel.usesJoinColumnJoiningStrategy()); - assertTrue(rel.usesJoinTableJoiningStrategy()); + assertFalse(rel.strategyIsJoinColumn()); + assertTrue(rel.strategyIsJoinTable()); } public void testVirtualMappingMetadataCompleteFalse() throws Exception { @@ -533,7 +533,7 @@ public class Eclipselink2_0OrmManyToOneMappingTests assertEquals(Boolean.FALSE, virtualManyToOneMapping.getSpecifiedOptional()); assertEquals("Address", virtualManyToOneMapping.getSpecifiedTargetEntity()); - JoinColumn virtualJoinColumn = virtualManyToOneMapping.getRelationship().getJoinColumnJoiningStrategy().specifiedJoinColumns().next(); + JoinColumn virtualJoinColumn = virtualManyToOneMapping.getRelationship().getJoinColumnStrategy().specifiedJoinColumns().next(); assertEquals("MY_COLUMN", virtualJoinColumn.getSpecifiedName()); assertEquals("MY_REFERENCED_COLUMN", virtualJoinColumn.getSpecifiedReferencedColumnName()); assertEquals(Boolean.TRUE, virtualJoinColumn.getSpecifiedUnique()); -- cgit v1.2.3